\RedBeanPHP\LoggerRDefault

Logger. Provides a basic logging function for RedBeanPHP.

Summary

Methods
Properties
Constants
log()
getLogs()
clear()
setMode()
grep()
No public properties found
C_LOGGER_ECHO
C_LOGGER_ARRAY
No protected methods found
$mode
$logs
N/A
No private methods found
No private properties found
N/A

Constants

C_LOGGER_ECHO

C_LOGGER_ECHO

Logger modes

C_LOGGER_ARRAY

C_LOGGER_ARRAY

Properties

$mode

$mode : integer

Type

integer

$logs

$logs : array

Type

array

Methods

log()

log() : void

Default logger method logging to STDOUT.

This is the default/reference implementation of a logger. This method will write the message value to STDOUT (screen) unless you have changed the mode of operation to C_LOGGER_ARRAY.

getLogs()

getLogs() : array

Returns the internal log array.

The internal log array is where all log messages are stored.

Returns

array

clear()

clear() : self

Clears the internal log array, removing all previously stored entries.

Returns

self

setMode()

setMode(integer  $mode) : self

Selects a logging mode.

There are several options available.

  • C_LOGGER_ARRAY - log silently, stores entries in internal log array only
  • C_LOGGER_ECHO - also forward log messages directly to STDOUT

Parameters

integer $mode

mode of operation for logging object

Returns

self

grep()

grep(string  $needle) : array

Searches for all log entries in internal log array for $needle and returns those entries.

This method will return an array containing all matches for your search query.

Parameters

string $needle

phrase to look for in internal log array

Returns

array