Handles output to the console and log file.
| OUTLVL_NONE | Disabled output level. |
| OUTLVL_FATAL | Fatal error output level. |
| OUTLVL_ERROR | General error output level. |
| OUTLVL_WARN | Warning output level. |
| OUTLVL_NOTICE | Notice output level. |
| OUTLVL_GENERAL | General output level. |
| OUTLVL_ALL | Full output level. |
| static setOutLvl | Sets the console or file output level. |
| static enableDebug | Enables or disables debug output. |
| static printMsg | Prints a message to the console and log file if the respective output levels are high enough. |
| static printlnMsg | Prints a message with a following line break to the console and log file if the respective output levels are high enough. |
| static printfMsg | Prints a message, which is formatted in the style of printf and sprintf, to the console and log file if the respective output levels are high enough. |
| static printlnDebug | Prints a debugging message to the console and log file if debug printing is enabled. |
Disabled output level.
In the context of configuration, this disables all output.
Fatal error output level.
In the context of configuration, this enables only fatal error output. In the context of output printing, this specifies a fatal error. This alerts the user to fatal errors and automatically terminates the application.
General error output level.
In the context of configuration, this enables fatal error and general error output. In the context of output printing, this specifies a general error. This alerts the user to non-fatal errors.
Warning output level.
In the context of configuration, this enables fatal error, general error, and warning output. In the context of output printing, this specifies a warning. This could warn the user of a potential error.
Notice output level.
In the context of configuration, this enables fatal error, general error, warning, and notice output. In the context of output printing, this specifies a notice. This could notify the user of possible unexpected behavior.
General output level.
In the context of configuration, this enables fatal error, general error, warning, notice, and general output. In the context of output printing, this specifies a general message. This is used to describe basic actions the application takes.
Full output level.
In the context of configuration, this enables all output.
public static boolean setOutLvl ( string $type , int $lvl )
Sets the console or file output level.
Parameters: $type - The output level type, either “console” or “file”. $lvl - The output level to set. Use the SysOut::OUTLVL_* constants.
Return Values:
none
public static void enableDebug ( [ bool $enable ] )
Enables or disables debug output.
Parameters: $enable - Whether to enable debug output - DEFAULT: true
Return Values:
None
public static void SysOut::printMsg ( string $msg [ , int $consoleOutLvl [ , int $fileOutLvl ] ] )
Prints a message to the console and log file if the respective output levels are high enough. Note that $fileOutLvl will be set to the value of $consoleOutLvl if left unspecified.
Parameters: $msg - The message to print. $consoleOutLvl - Output level for the console. - DEFAULT: SysOut::OUTLVL_GENERAL $fileOutLvl - Output level for the log file. - DEFAULT: $consoleOutLvl
Return Values:
None
public static void SysOut::printlnMsg ( string $msg [ , int $consoleOutLvl [ , int $fileOutLvl ] ] )
Prints a message with a following line break to the console and log file if the respective output levels are high enough. Note that $fileOutLvl will be set to the value of $consoleOutLvl if left unspecified.
Parameters: $msg - The message to print. $consoleOutLvl - Output level for the console. - DEFAULT: SysOut::OUTLVL_GENERAL $fileOutLvl - Output level for the log file. - DEFAULT: $consoleOutLvl
Return Values:
None
public static void SysOut::printfMsg ( string $format , array<mixed> $args [ , int $consoleOutLvl [ , int $fileOutLvl ] ] )
Prints a message, which is formatted in the style of printf and sprintf, to the console and log file if the respective output levels are high enough. Note that $fileOutLvl will be set to the value of $consoleOutLvl if left unspecified.
Parameters: $format - The format string to parse and print. $args - An array of arguments to insert into $format. $consoleOutLvl - Output level for the console. - DEFAULT: SysOut::OUTLVL_GENERAL $fileOutLvl - Output level for the log file. - DEFAULT: $consoleOutLvl
Return Values:
None
public static void printlnDebug ( string $msg )
Prints a debugging message to the console and log file if debug printing is enabled.
Parameters: $msg - The message to print.
Return Values:
None