LOG_LEVEL_DEBUG
LOG_LEVEL_DEBUG
Logger Class
Implementation and usage:
class PhalApi_Logger_Mock extends PhalApi_Logger {
public function log($type, $msg, $data) {
// nothing to do here ...
}
}
// save all kinds of the logs
$logger = new PhalApi_Logger_Mock(
PhalApi_Logger::LOG_LEVEL_DEBUG | PhalApi_Logger::LOG_LEVEL_INFO | PhalApi_Logger::LOG_LEVEL_ERROR);
// this is for developers, with more detail
$logger->debug('this is bebug test', array('name' => 'mock', 'ver' => '1.0.0'));
// this is for business
$logger->info('this is info test', 'and more detail here ...');
// something should not happen
$logger->error('this is error test');
log(string $type, string $msg, \string/array $data) : NULL
Record log
wtite the log into different storage medium according your need
string | $type | the type of log, such as info, debug, error, etc. |
string | $msg | key description of log |
\string/array | $data | infomation of the context |