loglib/tests/exception_handling.php

20 lines
676 B
PHP
Raw Normal View History

2023-01-29 21:43:44 -05:00
<?php
use LogLib\Log;
use LogLib\Objects\Options;
2023-01-29 21:43:44 -05:00
require('ncc');
2023-01-29 21:43:44 -05:00
import('net.nosial.loglib', 'latest');
$options = new Options('net.nosial.optslib');
Log::register($options);
Log::registerExceptionHandler();
Log::debug('net.nosial.optslib', 'This is a debug message');
Log::verbose('net.nosial.optslib', 'This is a verbose message');
Log::info('net.nosial.optslib', 'This is an info message');
Log::warning('net.nosial.optslib', 'This is a warning message');
Log::error('net.nosial.optslib', 'This is an error message');
Log::fatal('net.nosial.optslib', 'This is a fatal message');
throw new Exception('This is an exception');