Magrathea PHP 2

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

Methods

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

LoadLogsPath()

loads the path for saving log

public LoadLogsPath() : Logger
Return values
Logger

Log()

Logs a message - any message

public Log(string $logThis) : mixed
Parameters
$logThis : string

message to be logged

Tags
throws
Exception

If path is not writablle

LogError()

Logs an error

public LogError(mixed $error) : mixed
Parameters
$error : mixed

SetInstance()

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

__construct()

private final __construct() : mixed

CheckLogFileIsNull()

private CheckLogFileIsNull() : mixed

        
On this page

Search results