PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
pocketmine\utils\MainLogger Class Reference
+ Inheritance diagram for pocketmine\utils\MainLogger:
+ Collaboration diagram for pocketmine\utils\MainLogger:

Public Member Functions

 __construct (?string $logFile, bool $useFormattingCodes, string $mainThreadName, \DateTimeZone $timezone, bool $logDebug=false, ?string $logArchiveDir=null)
 
 addAttachment (ThreadSafeLoggerAttachment $attachment)
 
 alert ($message)
 
 buffer (\Closure $c)
 
 critical ($message)
 
 debug ($message)
 
 debug ($message, bool $force=false)
 
 emergency ($message)
 
 error ($message)
 
 getAttachments ()
 
 getFormat ()
 
 info ($message)
 
 log ($level, $message)
 
 logException (\Throwable $e, $trace=null)
 
 notice ($message)
 
 removeAttachment (ThreadSafeLoggerAttachment $attachment)
 
 removeAttachments ()
 
 setFormat (string $format)
 
 setLogDebug (bool $logDebug)
 
 shutdownLogWriterThread ()
 
 syncFlushBuffer ()
 
 warning ($message)
 

Protected Member Functions

 send (string $message, string $level, string $prefix, string $color)
 

Protected Attributes

ThreadSafeArray $attachments
 
bool $logDebug
 

Detailed Description

Definition at line 35 of file MainLogger.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\utils\MainLogger::__construct ( ?string $logFile,
bool $useFormattingCodes,
string $mainThreadName,
\DateTimeZone $timezone,
bool $logDebug = false,
?string $logArchiveDir = null )
Exceptions

RuntimeException

Definition at line 47 of file MainLogger.php.

◆ __destruct()

pocketmine\utils\MainLogger::__destruct ( )

Definition at line 217 of file MainLogger.php.

Member Function Documentation

◆ addAttachment()

pocketmine\thread\log\AttachableThreadSafeLogger::addAttachment ( ThreadSafeLoggerAttachment $attachment)
inherited

Definition at line 40 of file AttachableThreadSafeLogger.php.

◆ alert()

pocketmine\utils\MainLogger::alert ( $message)

Action must be taken immediately

Parameters
string$message
Returns
void

Implements Logger.

Definition at line 87 of file MainLogger.php.

◆ buffer()

pocketmine\utils\MainLogger::buffer ( \Closure $c)

@phpstan-param \Closure() : void $c

Implements BufferedLogger.

Definition at line 166 of file MainLogger.php.

◆ critical()

pocketmine\utils\MainLogger::critical ( $message)

Critical conditions

Parameters
string$message
Returns
void

Implements Logger.

Definition at line 91 of file MainLogger.php.

◆ debug() [1/2]

Logger::debug ( $message)
inherited

Detailed debug information.

Parameters
string$message
Returns
void

Implemented in SimpleLogger.

Referenced by pocketmine\resourcepacks\ResourcePackManager\__construct().

+ Here is the caller graph for this function:

◆ debug() [2/2]

pocketmine\utils\MainLogger::debug ( $message,
bool $force = false )

Definition at line 111 of file MainLogger.php.

◆ emergency()

pocketmine\utils\MainLogger::emergency ( $message)

System is unusable

Parameters
string$message
Returns
void

Implements Logger.

Definition at line 83 of file MainLogger.php.

◆ error()

pocketmine\utils\MainLogger::error ( $message)

Runtime errors that do not require immediate action but should typically be logged and monitored.

Parameters
string$message
Returns
void

Implements Logger.

Definition at line 95 of file MainLogger.php.

◆ getAttachments()

pocketmine\thread\log\AttachableThreadSafeLogger::getAttachments ( )
inherited
Returns
ThreadSafeLoggerAttachment[]

Definition at line 61 of file AttachableThreadSafeLogger.php.

◆ getFormat()

pocketmine\utils\MainLogger::getFormat ( )

Returns the current logger format used for console output.

Definition at line 64 of file MainLogger.php.

◆ info()

pocketmine\utils\MainLogger::info ( $message)

Interesting events.

Parameters
string$message
Returns
void

Implements Logger.

Definition at line 107 of file MainLogger.php.

◆ log()

pocketmine\utils\MainLogger::log ( $level,
$message )

Logs with an arbitrary level.

Parameters
mixed$level
string$message
Returns
void

Implements Logger.

Definition at line 134 of file MainLogger.php.

◆ logException()

pocketmine\utils\MainLogger::logException ( \Throwable $e,
$trace = null )
Parameters
mixed[][] | null$trace@phpstan-param list<array<string, mixed>>|null $trace
Returns
void

Implements Logger.

Definition at line 128 of file MainLogger.php.

◆ notice()

pocketmine\utils\MainLogger::notice ( $message)

Normal but significant events.

Parameters
string$message
Returns
void

Implements Logger.

Definition at line 103 of file MainLogger.php.

◆ removeAttachment()

pocketmine\thread\log\AttachableThreadSafeLogger::removeAttachment ( ThreadSafeLoggerAttachment $attachment)
inherited

Definition at line 44 of file AttachableThreadSafeLogger.php.

◆ removeAttachments()

pocketmine\thread\log\AttachableThreadSafeLogger::removeAttachments ( )
inherited

Definition at line 52 of file AttachableThreadSafeLogger.php.

◆ send()

pocketmine\utils\MainLogger::send ( string $message,
string $level,
string $prefix,
string $color )
protected

Definition at line 180 of file MainLogger.php.

◆ setFormat()

pocketmine\utils\MainLogger::setFormat ( string $format)

Sets the logger format to use for outputting text to the console. It should be an sprintf()able string accepting 5 string arguments:

  • time
  • color
  • thread name
  • prefix (debug, info etc)
  • message
See also
http://php.net/manual/en/function.sprintf.php

Definition at line 79 of file MainLogger.php.

◆ setLogDebug()

pocketmine\utils\MainLogger::setLogDebug ( bool $logDebug)

Definition at line 118 of file MainLogger.php.

◆ shutdownLogWriterThread()

pocketmine\utils\MainLogger::shutdownLogWriterThread ( )

Definition at line 170 of file MainLogger.php.

◆ syncFlushBuffer()

pocketmine\utils\MainLogger::syncFlushBuffer ( )

Definition at line 213 of file MainLogger.php.

◆ warning()

pocketmine\utils\MainLogger::warning ( $message)

Exceptional occurrences that are not errors.

Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.

Parameters
string$message
Returns
void

Implements Logger.

Definition at line 99 of file MainLogger.php.

Member Data Documentation

◆ $attachments

ThreadSafeArray pocketmine\thread\log\AttachableThreadSafeLogger::$attachments
protectedinherited

Definition at line 34 of file AttachableThreadSafeLogger.php.

◆ $logDebug

bool pocketmine\utils\MainLogger::$logDebug
protected

Definition at line 36 of file MainLogger.php.


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