Moodle PHP Documentation 4.1
Moodle 4.1.11 (Build: 20240610) (c8c84b4af18)
Moxiecode_Logger Class Reference

Logging utility class. More...

Public Member Functions

 __construct ()
 Constructs a new logger instance.
 
 _logMsg ($level, $message)
 
 debug ($msg)
 
 error ($msg)
 
 fatal ($msg)
 
 getFileName ()
 
 getFormat ()
 
 getLevel ()
 Returns the current log level for example MC_LOGGER_DEBUG.
 
 getMaxFiles ()
 
 getMaxSize ()
 
 getPath ()
 
 info ($msg)
 
 isDebugEnabled ()
 
 isErrorEnabled ()
 
 isFatalEnabled ()
 
 isInfoEnabled ()
 
 isWarnEnabled ()
 
 Moxiecode_Logger ()
 Old syntax of class constructor.
 
 setFileName ($file_name)
 
 setFormat ($format)
 
 setLevel ($level)
 Sets the current log level, use the MC_LOGGER constants.
 
 setMaxFiles ($max_files)
 
 setMaxSize ($size)
 
 setPath ($path)
 
 toOSPath ($path)
 Converts a Unix path to OS specific path.
 
 warn ($msg)
 

Public Attributes

 $_filename
 
 $_format
 
 $_level
 
 $_maxFiles
 
 $_maxSize
 
 $_maxSizeBytes
 
 $_path
 

Detailed Description

Logging utility class.

This class handles basic logging with levels, log rotation and custom log formats. It's designed to be compact but still powerful and flexible.

Member Function Documentation

◆ getLevel()

Moxiecode_Logger::getLevel ( )

Returns the current log level for example MC_LOGGER_DEBUG.

Return values
intCurrent log level for example MC_LOGGER_DEBUG.

◆ Moxiecode_Logger()

Moxiecode_Logger::Moxiecode_Logger ( )

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated
since Moodle 3.1

◆ setLevel()

Moxiecode_Logger::setLevel ( $level)

Sets the current log level, use the MC_LOGGER constants.

Parameters
int$levelLog level instance for example MC_LOGGER_DEBUG.

◆ toOSPath()

Moxiecode_Logger::toOSPath ( $path)

Converts a Unix path to OS specific path.

Parameters
String$pathUnix path to convert.

The documentation for this class was generated from the following file: