Logger
extends Singleton
in package
Magrathea class for logging anything By default, the message is written with a timestamp before it.
- For Log function, the default file is saved with a timestamp in the name
- For LogError function, by default, all the data is saved in a same file called log_error.log
Table of Contents
Properties
- $instance : array<string|int, mixed>|null
- $activeLogFile : mixed
- $logPath : mixed
Methods
- __wakeup() : mixed
- GetFullLogFile() : string
- Gets active log file
- GetLogFile() : string
- returns active log file name
- GetLogPath() : string
- Returns log path
- Initialize() : void
- Instance() : static|Singleton
- LoadLogsPath() : Logger
- loads the path for saving log
- Log() : mixed
- Logs a message - any message
- LogError() : mixed
- Logs an error
- MockClass() : static|Singleton
- SetInstance() : mixed
- SetLogFile() : Logger
- Sets the active log file
- SetLogPath() : Logger
- Sets log path
- __clone() : mixed
- __construct() : mixed
- CheckLogFileIsNull() : mixed
- StartLogName() : Logger
Properties
$instance
protected
static array<string|int, mixed>|null
$instance
= []
$activeLogFile
private
mixed
$activeLogFile
$logPath
private
mixed
$logPath
Methods
__wakeup()
public
final __wakeup() : mixed
GetFullLogFile()
Gets active log file
public
GetFullLogFile() : string
Return values
string —log path
GetLogFile()
returns active log file name
public
GetLogFile() : string
Return values
string —file name
GetLogPath()
Returns log path
public
GetLogPath() : string
Return values
string —$logPath
Initialize()
public
Initialize() : void
Instance()
public
static Instance() : static|Singleton
Return values
static|SingletonLoadLogsPath()
loads the path for saving log
public
LoadLogsPath() : Logger
Return values
LoggerLog()
Logs a message - any message
public
Log(string $logThis) : mixed
Parameters
- $logThis : string
-
message to be logged
Tags
LogError()
Logs an error
public
LogError(mixed $error) : mixed
Parameters
- $error : mixed
MockClass()
public
static MockClass(mixed $mocker) : static|Singleton
Parameters
- $mocker : mixed
Return values
static|SingletonSetInstance()
public
SetInstance(mixed $inst) : mixed
Parameters
- $inst : mixed
SetLogFile()
Sets the active log file
public
SetLogFile(string $name) : Logger
Parameters
- $name : string
Return values
Logger —itself
SetLogPath()
Sets log path
public
SetLogPath(string $p) : Logger
Parameters
- $p : string
-
path for the logs folder
Return values
Logger__clone()
protected
final __clone() : mixed
__construct()
private
final __construct() : mixed
CheckLogFileIsNull()
private
CheckLogFileIsNull() : mixed
StartLogName()
private
StartLogName() : Logger