MessageLogger Class Reference

Inheritance diagram for MessageLogger:
DebuggingMessageLogger ImportMessageLogger

Public Member Functions

 __construct ($messageStreamer=null)
 addInfoMessage ($message)
 addErrorMessage ($message)
 addDebugMessage ($message)
 getMessages ()
 printMessages ($return=false, $errorOnly=false)
 isErrorMessagePresent ()

Static Public Member Functions

static getTypeLabel ($type)

Data Fields

const ERROR = 1
const INFO = 2
const DEBUG = 3
 $logDateTimeStamp = true

Protected Member Functions

 add ($message)
 shouldPrintDebugMessages ()

Static Protected Member Functions

static getFormattedDateTimeStampForNow ()

Protected Attributes

 $errorMessagePresent = false
 $messages = array()
 $messageStreamers = array()

Detailed Description

Helper utility to capture information and error messages during the execution of functions.

Definition at line 40 of file MessageLogger.php.

Constructor & Destructor Documentation

__construct ( messageStreamer = null  ) 

Specify a MessageStreamer if desired. A message streamer can allow messages to be streamed to the user interface or command line as they are generated instead of waiting for the entire output to be finished.

object $messageStreamer MessageStreamer or array of MessageStreamers or null
See also:
MessageStreamer class

Definition at line 85 of file MessageLogger.php.

Member Function Documentation

addInfoMessage ( message  ) 

Add an informational message.

string $message

Definition at line 108 of file MessageLogger.php.

addErrorMessage ( message  ) 

Add an error message.

string $message

Definition at line 117 of file MessageLogger.php.

addDebugMessage ( message  ) 

Add debug message.

string $message

Definition at line 127 of file MessageLogger.php.

printMessages ( return = false,
errorOnly = false 

Print messages. If $return is true, then the

value is a string representing the message content.
boolean $return
boolean $errorOnly - Only print the error messages.

Definition at line 167 of file MessageLogger.php.

static getTypeLabel ( type  )  [static]

Given a message type, get the corresponding translated display label.

integer $type

Definition at line 192 of file MessageLogger.php.

isErrorMessagePresent (  ) 
boolean true if at least one error message is present.

Definition at line 212 of file MessageLogger.php.

shouldPrintDebugMessages (  )  [protected]

Reimplemented in DebuggingMessageLogger.

Definition at line 220 of file MessageLogger.php.

static getFormattedDateTimeStampForNow (  )  [static, protected]

Blocking error on date because that is how Yii::log does it. Not sure why this is the case.


Definition at line 233 of file MessageLogger.php.

Field Documentation

const ERROR = 1

Error message type.

Definition at line 45 of file MessageLogger.php.

const INFO = 2

Info message type.

Definition at line 50 of file MessageLogger.php.

const DEBUG = 3

Debug Message type.

Definition at line 55 of file MessageLogger.php.

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Fri Nov 15 07:11:01 2019