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()
 $messageStreamer
 $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.

Parameters:
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.

Parameters:
string $message

Definition at line 108 of file MessageLogger.php.

addErrorMessage ( message  ) 

Add an error message.

Parameters:
string $message

Definition at line 117 of file MessageLogger.php.

addDebugMessage ( message  ) 

Add debug message.

Parameters:
string $message

Definition at line 127 of file MessageLogger.php.

printMessages ( return = false,
errorOnly = false 
)

Print messages. If $return is true, then the

Returns:
value is a string representing the message content.
Parameters:
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.

Parameters:
integer $type

Definition at line 192 of file MessageLogger.php.

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

Definition at line 212 of file MessageLogger.php.

shouldPrintDebugMessages (  )  [protected]
Returns:
bool

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.

Returns:
bool|string

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 Thu Jun 22 07:10:27 2017