Central logging class. Logs to file, relays messages to the frontend, submits crash reports.
More...
|
| static void | LogToConsole ([NotNull] string message) |
| | Logs a message of type ConsoleOutput, strips colors, and splits into multiple messages at newlines. Use this method for all messages of LogType.ConsoleOutput
|
| |
| static void | Log (LogType type,[NotNull] string message,[NotNull] params object[] args) |
| | Adds a message to the server log. Depending on server configuration and log category, message can be shown in console, logged to file, both, or neither.
|
| |
| static void | DisableFileLogging () |
| | Disables all file logging (sets all LogFileOptions to false).
|
| |
| static void | LogAndReportCrash ([CanBeNull] string message,[CanBeNull] string assembly,[CanBeNull] Exception exception, bool shutdownImminent) |
| | Logs and reports a crash or an unhandled exception. Details are logged, and a crash report may be submitted to fCraft.net. Note that this method may take several seconds to finish, since it gathers system information and possibly communicates to fCraft.net.
|
| |
|
| static bool | Enabled [get, set] |
| | Gets or sets whether logging is globally enabled/disabled. If "–nolog" command-line argument is given, logging is disabled.
|
| |
| static string | CurrentLogFileName [get] |
| | Name of the file that log messages are currently being written to. Does not include path to the log folder (see Paths.LogPath for that).
|
| |
| static LogSplittingType | SplittingType [get, set] |
| |
|
| static EventHandler< LogEventArgs > | Logged |
| | Occurs after a message has been logged.
|
| |
static EventHandler
< CrashedEventArgs > | Crashed |
| | Occurs when the server "crashes" (has an unhandled exception). Note that such occurences will not always cause shutdowns - check ShutdownImminent property. Reporting of the crash may be suppressed.
|
| |
Central logging class. Logs to file, relays messages to the frontend, submits crash reports.
| static void fCraft.Logger.DisableFileLogging |
( |
| ) |
|
|
static |
Disables all file logging (sets all LogFileOptions to false).
| static void fCraft.Logger.Log |
( |
LogType |
type, |
|
|
[NotNull] string |
message, |
|
|
[NotNull] params object[] |
args |
|
) |
| |
|
static |
Adds a message to the server log. Depending on server configuration and log category, message can be shown in console, logged to file, both, or neither.
- Parameters
-
| type | Type of message. |
| message | Format string for the message. Uses same syntax as String.Format. |
| args | An System.Object array containing zero or more objects to format. |
- Exceptions
-
| ArgumentNullException | Message or args is null. |
| FormatException | String.Format rejected formatting. |
| static void fCraft.Logger.LogAndReportCrash |
( |
[CanBeNull] string |
message, |
|
|
[CanBeNull] string |
assembly, |
|
|
[CanBeNull] Exception |
exception, |
|
|
bool |
shutdownImminent |
|
) |
| |
|
static |
Logs and reports a crash or an unhandled exception. Details are logged, and a crash report may be submitted to fCraft.net. Note that this method may take several seconds to finish, since it gathers system information and possibly communicates to fCraft.net.
- Parameters
-
| message | Description/context of the crash. May be null if unknown. |
| assembly | Assembly or component where the crash/exception was caught. May be null if unknown. |
| exception | Exception. May be null. |
| shutdownImminent | Whether this crash will likely report in a server shutdown. Used for Logger.Crashed event. |
| static void fCraft.Logger.LogToConsole |
( |
[NotNull] string |
message | ) |
|
|
static |
Logs a message of type ConsoleOutput, strips colors, and splits into multiple messages at newlines. Use this method for all messages of LogType.ConsoleOutput
| readonly bool [] fCraft.Logger.ConsoleOptions |
|
static |
| readonly bool [] fCraft.Logger.LogFileOptions |
|
static |
| string fCraft.Logger.CurrentLogFileName |
|
staticget |
Name of the file that log messages are currently being written to. Does not include path to the log folder (see Paths.LogPath for that).
| bool fCraft.Logger.Enabled |
|
staticgetset |
Gets or sets whether logging is globally enabled/disabled. If "–nolog" command-line argument is given, logging is disabled.
Occurs when the server "crashes" (has an unhandled exception). Note that such occurences will not always cause shutdowns - check ShutdownImminent property. Reporting of the crash may be suppressed.
Occurs after a message has been logged.
The documentation for this class was generated from the following file: