Public Member Functions | |
__construct ($logDirectory, $logLevelThreshold=LogLevel::DEBUG) | |
__destruct () | |
setDateFormat ($dateFormat) | |
setLogLevelThreshold ($logLevelThreshold) | |
log ($level, $message, array $context=array()) | |
write ($message) | |
Finally, a light, permissions-checking logging class.
Originally written for use with wpSearch
Usage: $log = new Katzgrau('/var/log/', Psr::INFO); $log->info('Returned a million search results'); //Prints to the log file $log->error('Oh dear.'); //Prints to the log file $log->debug('x = 5'); //Prints nothing due to current severity threshhold
Katzgrau\KLogger\Logger::__construct | ( | $logDirectory, | |
$logLevelThreshold = LogLevel::DEBUG |
|||
) |
Class constructor
string | $logDirectory | File path to the logging directory |
integer | $logLevelThreshold | The LogLevel Threshold |
Katzgrau\KLogger\Logger::__destruct | ( | ) |
Class destructor
Katzgrau\KLogger\Logger::log | ( | $level, | |
$message, | |||
array | $context = array() |
||
) |
Logs with an arbitrary level.
mixed | $level | |
string | $message | |
array | $context |
Katzgrau\KLogger\Logger::setDateFormat | ( | $dateFormat | ) |
Sets the date format used by all instances of KLogger
string | $dateFormat | Valid format string for date() |
Katzgrau\KLogger\Logger::setLogLevelThreshold | ( | $logLevelThreshold | ) |
Sets the Log Level Threshold
string | $dateFormat | Valid format string for date() |
Katzgrau\KLogger\Logger::write | ( | $message | ) |
Writes a line to the log without prepending a status or timestamp
string | $line | Line to write to the log |