API Documentation for: 1.0.1
Show:

Logger Class

Namespace: Canteen\Logger

Handle the log statements that get outputted when we're running debug mode. Located in the namespace Logger.

Item Index

Properties

Methods

assertHandler

(
  • script
  • line
  • message
)

Handle asserts from PHP

Parameters:

  • script String

    The name of the script

  • line Int

    The line number

  • message String

    The message of the error

init

() static

Initialize the singleton for Logger

instance

() Logger static

Get the single instance of Logger

Returns:

Logger:

The singleton instance of Logger

log

(
  • object
  • [level='GENERAL']
  • [htmlEntities=true]
)

The generic log statement

Parameters:

  • object Mixed

    The object, array or string to log

  • [level='GENERAL'] String optional

    The level to log at

  • [htmlEntities=true] Boolean optional

    Convert any html entities to charcodes

render

() String

Get the logger body content

Returns:

String:

The output result of the logger, to be added to a page.

setMinimumLevel

(
  • level
)

Set the minimum log level required to show

Parameters:

  • level String

    Don't show message with less log level than this

Properties

DEBUG

String final static

For logging out debug messages

enabled

Boolean public

If we want to enable this

ERROR

String final static

For logging out error messages

GENERAL

String final static

The most general log level, for general message

GENERAL

String final static

For logging out info messages

instance

Logger protected static

The singleton instance

minLevel

Int protected

The minimum level show

traceOutput

String protected

The output string to show

WARNING

String final static

For logging out warning messages