Class Swift_Log

Description

The Logger class/interface.

Located in /Swift/Log.php (line 16)


	
			
Direct descendents
Class Description
Swift_Log_DefaultLog The Default Logger class
Class Constant Summary
 COMMAND = ">>"
 ERROR = "!!"
 NORMAL = "++"
 RESPONSE = "<<"
Variable Summary
Method Summary
void add (string $text, [string $type = self::NORMAL])
void addFailedRecipient (string $address)
void clear ()
void dump ([boolean $return_only = false])
int getLogLevel ()
int getMaxSize ()
boolean hasLevel (int $level)
void isEnabled ()
void setLogLevel (int $level)
void setMaxSize (int $size)
Variables
array $failedRecipients = array() (line 58)

Failed recipients

  • access: protected
int $logLevel = self::LOG_NOTHING (line 68)

The level of logging currently set.

  • access: protected
int $maxSize = 50 (line 63)

The maximum number of log entries

  • access: protected
Methods
add (line 75)

Add a new entry to the log

  • access: public
  • abstract:
void add (string $text, [string $type = self::NORMAL])
  • string $text: The information to log
  • string $type: The type of entry (see the constants: COMMAND, RESPONSE, ERROR, NORMAL)

Redefined in descendants as:
addFailedRecipient (line 96)

Add a failed recipient to the list

  • access: public
void addFailedRecipient (string $address)
  • string $address: The address of the recipient
clear (line 84)

Empty the log contents

  • access: public
  • abstract:
void clear ()

Redefined in descendants as:
dump (line 80)

Dump the contents of the log to the browser.

  • access: public
  • abstract:
void dump ([boolean $return_only = false])
  • boolean $return_only: True if the string should be returned rather than output.

Redefined in descendants as:
getFailedRecipients (line 105)

Get the list of failed recipients

  • access: public
array getFailedRecipients ()
getLogLevel (line 139)

Get the current log level.

  • access: public
int getLogLevel ()
getMaxSize (line 121)

Get the current maximum allowed log size

  • access: public
int getMaxSize ()
hasLevel (line 148)

Check if the log level includes the one given.

  • access: public
boolean hasLevel (int $level)
  • int $level: Level
isEnabled (line 88)

Check if logging is enabled.

  • access: public
void isEnabled ()
setLogLevel (line 129)

Set the log level to one of the constants provided.

  • access: public
void setLogLevel (int $level)
  • int $level: Level
setMaxSize (line 113)

Set the maximum size of this log (zero is no limit)

  • access: public
void setMaxSize (int $size)
  • int $size: The maximum entries
Class Constants
COMMAND = ">>" (line 21)

A command type entry

ERROR = "!!" (line 29)

An error type entry

LOG_ERRORS = 1 (line 41)

Only errors are logged.

LOG_EVERYTHING = 4 (line 53)

Runtime info + SMTP instructions + failures + errors.

LOG_FAILURES = 2 (line 45)

Errors + sending failures.

LOG_NETWORK = 3 (line 49)

All SMTP instructions + failures + errors.

LOG_NOTHING = 0 (line 37)

Logging is off.

NORMAL = "++" (line 33)

A standard entry

RESPONSE = "<<" (line 25)

A response type entry

Documentation generated on Wed, 26 Mar 2008 20:33:08 +1100 by phpDocumentor 1.3.1