MainLogger
extends AttachableThreadedLogger
in package
implements
BufferedLogger
Interfaces, Classes, Traits and Enums
Table of Contents
- $attachments : Volatile|array<string|int, ThreadedLoggerAttachment>
- $logDebug : bool
- $format : string
- $logWriterThread : MainLoggerThread
- $mainThreadName : string
- $timezone : string
- $useFormattingCodes : bool
- __construct() : mixed
- __destruct() : mixed
- addAttachment() : void
- alert() : mixed
- buffer() : void
- Buffers log messages while the closure is executed, and then flushes the buffer.
- critical() : mixed
- debug() : mixed
- emergency() : mixed
- error() : mixed
- getAttachments() : array<string|int, ThreadedLoggerAttachment>
- getFormat() : string
- Returns the current logger format used for console output.
- info() : mixed
- log() : mixed
- logException() : void
- notice() : mixed
- removeAttachment() : void
- removeAttachments() : void
- setFormat() : void
- Sets the logger format to use for outputting text to the console.
- setLogDebug() : void
- shutdownLogWriterThread() : void
- syncFlushBuffer() : void
- warning() : mixed
- send() : void
Properties
$attachments
protected
Volatile|array<string|int, ThreadedLoggerAttachment>
$attachments
$logDebug
protected
bool
$logDebug
$format
private
string
$format
= \pocketmine\utils\TextFormat::AQUA . "[%s] " . \pocketmine\utils\TextFormat::RESET . "%s[%s/%s]: %s" . \pocketmine\utils\TextFormat::RESET
$logWriterThread
private
MainLoggerThread
$logWriterThread
$mainThreadName
private
string
$mainThreadName
$timezone
private
string
$timezone
$useFormattingCodes
private
bool
$useFormattingCodes
= false
Methods
__construct()
public
__construct(string $logFile, bool $useFormattingCodes, string $mainThreadName, DateTimeZone $timezone[, bool $logDebug = false ]) : mixed
Parameters
- $logFile : string
- $useFormattingCodes : bool
- $mainThreadName : string
- $timezone : DateTimeZone
- $logDebug : bool = false
Tags
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
mixed —addAttachment()
public
addAttachment(ThreadedLoggerAttachment $attachment) : void
Parameters
- $attachment : ThreadedLoggerAttachment
Return values
void —alert()
public
alert(mixed $message) : mixed
Parameters
- $message : mixed
Return values
mixed —buffer()
Buffers log messages while the closure is executed, and then flushes the buffer.
public
buffer(Closure $c) : void
Parameters
- $c : Closure
Tags
Return values
void —critical()
public
critical(mixed $message) : mixed
Parameters
- $message : mixed
Return values
mixed —debug()
public
debug(mixed $message[, bool $force = false ]) : mixed
Parameters
- $message : mixed
- $force : bool = false
Return values
mixed —emergency()
public
emergency(mixed $message) : mixed
Parameters
- $message : mixed
Return values
mixed —error()
public
error(mixed $message) : mixed
Parameters
- $message : mixed
Return values
mixed —getAttachments()
public
getAttachments() : array<string|int, ThreadedLoggerAttachment>
Return values
array<string|int, ThreadedLoggerAttachment> —getFormat()
Returns the current logger format used for console output.
public
getFormat() : string
Return values
string —info()
public
info(mixed $message) : mixed
Parameters
- $message : mixed
Return values
mixed —log()
public
log(mixed $level, mixed $message) : mixed
Parameters
- $level : mixed
- $message : mixed
Return values
mixed —logException()
public
logException(Throwable $e[, array<string|int, array<string|int, mixed>>|null $trace = null ]) : void
Parameters
- $e : Throwable
- $trace : array<string|int, array<string|int, mixed>>|null = null
Tags
Return values
void —notice()
public
notice(mixed $message) : mixed
Parameters
- $message : mixed
Return values
mixed —removeAttachment()
public
removeAttachment(ThreadedLoggerAttachment $attachment) : void
Parameters
- $attachment : ThreadedLoggerAttachment
Return values
void —removeAttachments()
public
removeAttachments() : void
Return values
void —setFormat()
Sets the logger format to use for outputting text to the console.
public
setFormat(string $format) : void
It should be an sprintf()able string accepting 5 string arguments:
- time
- color
- thread name
- prefix (debug, info etc)
- message
Parameters
- $format : string
Tags
Return values
void —setLogDebug()
public
setLogDebug(bool $logDebug) : void
Parameters
- $logDebug : bool
Return values
void —shutdownLogWriterThread()
public
shutdownLogWriterThread() : void
Return values
void —syncFlushBuffer()
public
syncFlushBuffer() : void
Return values
void —warning()
public
warning(mixed $message) : mixed
Parameters
- $message : mixed
Return values
mixed —send()
protected
send(string $message, string $level, string $prefix, string $color) : void
Parameters
- $message : string
- $level : string
- $prefix : string
- $color : string