MediaSearch
[ class tree: MediaSearch ] [ index: MediaSearch ] [ all elements ]

Class: MediaSearch_Log

Source Location: /MediaSearch/Log.php

Class Overview


This pure static class provides logging facility.


Author(s):

Copyright:

  • Copyright (c) 2009 Sven Strittmatter

Constants

Methods



Class Details

[line 49]
This pure static class provides logging facility.

First you need to specify a global log level. After that you need to add minimum one log backend object (implementation of MediaSearch_Log_Interface). Then you can use the logger.

Example

  1.  // shows only info logs on cli
  2.  MediaSearch_Log::MediaSearch_Log_Cli(MediaSearch_Log::INFO);
  3.  // logs everything to the log file
  4.  MediaSearch_Log::MediaSearch_Log_Cli('path/to/log'MediaSearch_Log_File::ALL);
  5.  // ..
  6.  MediaSearch_Log::info('log info message');
  7.  // ..
  8.  MediaSearch_Log::error('log an error');
  9.  // ..
  10.  MediaSearch_Log::Debug('log debug message'array($debugVar1);
  11.  MediaSearch_Log::Debug('log debug message'array($debugVar1$debugVar2);




Tags:

copyright:  Copyright (c) 2009 Sven Strittmatter
final:  
usedby:  ScannerApplication
usedby:  IndexerApplication


[ Top ]


Class Methods


static method add [line 189]

static void add( $logger)

Adds log backends. You can add as man as you want.

Each logger obejct can have its own log level. So you can log e.g. all info() and trace() messages to file and all fatal() to en email implemtation.




Tags:

access:  public


Parameters:

MediaSearch_Log_Interface   $logger  

[ Top ]

static method debug [line 239]

static void debug( string $message, [ $variables = null])

Call this method to log a debug message.

Optional passed variables are dumped in the logfile.




Tags:

access:  public


Parameters:

string   $message  
array   $variables   Additional variabls to debug

[ Top ]

static method error [line 269]

static void error( string $message)

Call this method to log a eroor message.



Tags:

access:  public


Parameters:

string   $message  

[ Top ]

static method fatal [line 284]

static void fatal( string $message)

Call this method to log a fatal message.



Tags:

access:  public


Parameters:

string   $message  

[ Top ]

static method getLevel [line 175]

static int getLevel( )

Returns the global log level.



Tags:

access:  public


[ Top ]

static method info [line 204]

static void info( string $message)

Call this method to log a info message.



Tags:

access:  public


Parameters:

string   $message  

[ Top ]

static method isEnabled [line 120]

static bool isEnabled( int $logLevel)

Determines if the given loglevel is enabled in the global loglevel.



Tags:

access:  public


Parameters:

int   $logLevel  

[ Top ]

static method setLevel [line 164]

static void setLevel( [int $integer = self::DISABLED])

Sets the global log level. Use anny bitewise combination of the class constants.

Examples:

  1.  // ...




Tags:

access:  public


Parameters:

int   $integer   Defauklt is MediaSearch_Log::DISABLED

[ Top ]

static method trace [line 222]

static void trace( string $message, [int $traceLevel = 0])

Call this method to log a trace message.

You can specify a trace level. You can grep for this like: grep "TRACE-11' if your tracelevel is 11.




Tags:

access:  public


Parameters:

string   $message  
int   $traceLevel  

[ Top ]

static method warn [line 254]

static void warn( string $message)

Call this method to log a warn message.



Tags:

access:  public


Parameters:

string   $message  

[ Top ]


Class Constants

ALL =  63

[line 83]

Enables all loglevels together.


[ Top ]

DEBUG =  4

[line 67]

Enables loglevel debug.


[ Top ]

DISABLED =  0

[line 55]

Disable all logging.


[ Top ]

ERROR =  16

[line 75]

Enables loglevel error.


[ Top ]

FATAL =  32

[line 79]

Enables loglevel fatal.


[ Top ]

INFO =  1

[line 59]

Enables loglevel info.


[ Top ]

TRACE =  2

[line 63]

Enables loglevel trace.


[ Top ]

TRACE_LELVEL =  57

[line 50]


[ Top ]

WARN =  8

[line 71]

Enables loglevel warn.


[ Top ]



Documentation generated on Mon, 17 Aug 2009 14:53:36 +0200 by phpDocumentor 1.4.2