public function testLogCanHaveCustomFilter() { global $logFilter; Log::error("This is a test we should not see", "ignore"); $this->assertCount(0, $this->log->entries); $logFilter = true; Log::error("This is a test we should not see", "test"); $this->assertCount(0, $this->log->entries); }
protected function logException(RhubarbException $er) { Log::error("Unhandled " . basename(get_class($er)) . " `" . $er->getMessage() . "` in line " . $er->getLine() . " in " . $er->getFile(), "ERROR", $er); }
* See the License for the specific language governing permissions and * limitations under the License. */ /** * execute-http.php is the entry point for all HTTP requests for Rhubarb applications. * The only exceptions to this are when webserver URL rewriting goes directly to * a resource for performance reasons, e.g. accessing static content like images * and CSS files. */ use Rhubarb\Crown\Logging\Log; use Rhubarb\Crown\Module; // Change the working directory to the top level project folder. chdir(__DIR__ . "/../../../../"); // Initiate our bootstrap script to boot all libraries required. require_once __DIR__ . "/boot.php"; require_once __DIR__ . "/../src/Module.php"; require_once __DIR__ . "/../src/Context.php"; $request = \Rhubarb\Crown\Context::currentRequest(); try { // Pass control to the Module class and ask it to generate a response for the // incoming request. $response = Module::generateResponseForRequest($request); $response->send(); } catch (\Exception $er) { $context = new \Rhubarb\Crown\Context(); if ($context->DeveloperMode) { Log::error($er->getMessage(), "ERROR"); print "<pre>Exception: " . get_class($er) . "\nMessage: " . $er->getMessage() . "\nStack Trace:\n" . $er->getTraceAsString(); } } Log::debug("Request Complete", "ROUTER");