Documentation

CoreLogger extends AbstractLogger
in package
implements Logger

The default implementation of the Logger interface.

The active logger can be defined in the config file.

Tags
author

Jason Savell jsavell@library.tamu.edu

Table of Contents

Interfaces

Logger
An interface defining a Logger

Properties

$logLevel  : int

Methods

log()  : mixed
setLogLevel()  : void
Sets the threshold for which log entries should actually get written to the log
warn()  : void
getCaller()  : array<string|int, mixed>
Build the debug backtrace and extract the calling class
getFormattedCaller()  : string
Returns the calling class info as a string
writeToLog()  : void
Writes an entry to the PHP error log using PHP's trigger_error() function

Properties

$logLevel

private int $logLevel = 3

The log level of a CoreLogger instance (defaults to 3)

Methods

log()

public log(mixed $level, mixed $message[, mixed $context = [] ]) : mixed
Parameters
$level : mixed
$message : mixed
$context : mixed = []

setLogLevel()

Sets the threshold for which log entries should actually get written to the log

public setLogLevel(int $logLevel) : void
Parameters
$logLevel : int

Range of 0-3, with 3 being the least verbose

warn()

public warn(mixed $message) : void
Parameters
$message : mixed

The warning message

getCaller()

Build the debug backtrace and extract the calling class

protected getCaller() : array<string|int, mixed>
Return values
array<string|int, mixed>

The details of the calling class

getFormattedCaller()

Returns the calling class info as a string

protected getFormattedCaller() : string
Return values
string

writeToLog()

Writes an entry to the PHP error log using PHP's trigger_error() function

protected writeToLog(string $level, string $message) : void
Parameters
$level : string

The log level

$message : string

The log message


        
On this page

Search results