Class for logging messages to a file.
More...
|
| Logger (string filename, bool toFile=true) |
| Logger constructor.
|
|
void | info (string info, bool writeToConsole=true) |
| Log information.
|
|
void | info (string info, ConsoleColor color) |
| Log information and print to stdout with specified color.
|
|
void | warning (string warning, bool writeToConsole=true) |
| Log warning.
|
|
void | error (string error, bool writeToConsole=true) |
| Log error.
|
|
void | success (string success, bool writeToConsole=true) |
| Log success.
|
|
void | dispose () |
| Close and flush the logger.
|
|
|
bool | logToFile = false |
| If messages should be written to file or only printed to stdout.
|
|
Class for logging messages to a file.
Definition at line 8 of file Logger.cs.
◆ Logger()
Util.Logger.Logger |
( |
string | filename, |
|
|
bool | toFile = true ) |
Logger constructor.
- Parameters
-
filename | The log filename. |
toFile | If messages should be written to file or only printed to stdout. |
Definition at line 20 of file Logger.cs.
◆ dispose()
void Util.Logger.dispose |
( |
| ) |
|
Close and flush the logger.
Definition at line 107 of file Logger.cs.
◆ error()
void Util.Logger.error |
( |
string | error, |
|
|
bool | writeToConsole = true ) |
Log error.
- Parameters
-
error | The error message to be logged. |
writeToConsole | If the message should be printed to stdout or not. |
Definition at line 77 of file Logger.cs.
◆ info() [1/2]
void Util.Logger.info |
( |
string | info, |
|
|
bool | writeToConsole = true ) |
Log information.
- Parameters
-
info | The information message to be logged. |
writeToConsole | If the message should be printed to stdout or not. |
Definition at line 34 of file Logger.cs.
◆ info() [2/2]
void Util.Logger.info |
( |
string | info, |
|
|
ConsoleColor | color ) |
Log information and print to stdout with specified color.
- Parameters
-
info | The information message to be logged. |
color | The foreground color to be used for stdout (if supported). |
Definition at line 48 of file Logger.cs.
◆ success()
void Util.Logger.success |
( |
string | success, |
|
|
bool | writeToConsole = true ) |
Log success.
- Parameters
-
success | The success message to be logged. |
writeToConsole | If the message should be printed to stdout or not. |
Definition at line 93 of file Logger.cs.
◆ warning()
void Util.Logger.warning |
( |
string | warning, |
|
|
bool | writeToConsole = true ) |
Log warning.
- Parameters
-
warning | The warning message to be logged. |
writeToConsole | If the message should be printed to stdout or not. |
Definition at line 61 of file Logger.cs.
◆ logToFile
bool Util.Logger.logToFile = false |
If messages should be written to file or only printed to stdout.
Definition at line 13 of file Logger.cs.
The documentation for this class was generated from the following file:
- C:/Users/Micha/Documents/GitHub/dotnet_template/util/Logger.cs