Constants

DISABLED

DISABLED = -1

LOG

LOG = 0

WARNING

WARNING = 1

INFO

INFO = 2

DEBUG

DEBUG = 3

LOG_COLOR

LOG_COLOR = '#999999'

DEBUG_COLOR

DEBUG_COLOR = '#666666'

INFO_COLOR

INFO_COLOR = '#276f86'

WARNING_COLOR

WARNING_COLOR = '#9f3a38;'

Properties

$logFileNamePrefix

$logFileNamePrefix : string

Private varibale to hold the log file prefix.

Type

string — Default 'mainwp'

$logFileNameSuffix

$logFileNameSuffix : string

Private varibale to hold the log file suffix.

Type

string — Default '.log'

$logMaxMB

$logMaxMB : integer

Private varibale to hold the log file max size.

Type

integer — Default 0.5

$logDateFormat

$logDateFormat : string

Private varibale to hold the log file date format.

Type

string — Default 'Y-m-d H:i:s'

$logDirectory

$logDirectory : mixed

Private varibale to hold the log file output directory.

Type

mixed — Default null

$logPriority

$logPriority : string

Private varibale to hold the log file priotrity.

Type

string — Disabled

$instance

$instance : mixed

Private static varibale to hold the instance.

Type

mixed — Default null

Methods

instance()

instance() : self

Method instance()

Returns new MainWP_Logger instance.

Returns

self —

MainWP_Logger

set_log_priority()

set_log_priority(mixed  $logPriority) 

Method set_log_priority()

Sets the log priority.

Parameters

mixed $logPriority

Log priority value.

get_log_status()

get_log_status() : mixed

Method get_log_status()

Get log status.

Returns

mixed —

$enabled log status.

debug()

debug(string  $text) : string

Method debug()

Grab debug.

Parameters

string $text

Debug message text.

Returns

string —

Log debug message.

info()

info(string  $text) : string

Method info()

Grab info.

Parameters

string $text

Info message text.

Returns

string —

Log info message.

warning()

warning(string  $text) : string

Method warning()

Grab warning information.

Parameters

string $text

Warning message text.

Returns

string —

Log warning message.

debug_for_website()

debug_for_website(object  $website, string  $action, string  $message) : mixed

Method debug_for_website()

Grab website debug and info.

Parameters

object $website

Child site object.

string $action

Performed action.

string $message

Debug message.

Returns

mixed —

Website debug info.

info_for_website()

info_for_website(object  $website, string  $action, string  $message) : mixed

Method info_for_website()

Grab Website Info.

Parameters

object $website

Child site object.

string $action

Performed action.

string $message

Info message.

Returns

mixed —

Website Info.

warning_for_website()

warning_for_website(object  $website, string  $action, string  $message, boolean  $addStackTrace = true) : string

Method warning_for_website()

Grab Website Warnings.

Parameters

object $website

Child site object.

string $action

Performed action.

string $message

Warning message.

boolean $addStackTrace

Add or Don't add stack trace.

Returns

string —

Website warnings.

log_to_db()

log_to_db(string  $text, integer  $priority) : boolean

Method log()

Log to database.

Parameters

string $text

Log record text.

integer $priority

Set priority.

Returns

boolean —

true|false Default is False.

log()

log(string  $text, integer  $priority) : boolean

Method log()

Create Log File.

Parameters

string $text

Log record text.

integer $priority

Set priority.

Returns

boolean —

true|false Default is False.

prepare_log_info()

prepare_log_info(mixed  $data) : mixed

Method prepare_log_info()

Prepare log data.

Parameters

mixed $data

Log data.

Returns

mixed —

$data filtered data.

prepend()

prepend(mixed  $string, mixed  $filename) 

Method prepend()

Prepend content to log file.

Parameters

mixed $string

Custom string.

mixed $filename

Filename.

get_log_file()

get_log_file() : mixed

Method get_log_file()

Grab Log File.

Returns

mixed —

Log File.

get_log_text()

get_log_text(mixed  $priority) : string

Method get_log_text()

Grab what type of log entry.

Parameters

mixed $priority

Set priority.

Returns

string —

LOG -OR- DISABLED|DEBUG|INFO|WARNING|INFO UPDATE

check_log_daily()

check_log_daily(integer  $days = false) 

Method check_log_daily()

Daily checks to clear the log file.

Parameters

integer $days

number of days to keep logs.

clear_log_db()

clear_log_db() 

Method clear_log_db()

Clear the log file.

clear_log()

clear_log() 

Method clear_log()

Clear the log file.

show_log_db()

show_log_db() 

Method show_log_db()

Grab log file and build output to screen.

show_log()

show_log() 

Method show_log()

Grab log file and build output to screen.

__construct()

__construct() 

MainWP_Logger constructor.

Run each time the class is called.