Class Log
- Namespace
- Sdl3Sharp
- Assembly
- Sdl3Sharp.dll
Provides simple logging routines with messages using priorities and categories
public static class Log
- Inheritance
-
Log
- Inherited Members
Properties
UseDefaultOutputForUnhandledMessages
Gets or sets a value that indicates whether unhandled logging messages should get passed to the default SDL logging output
public static bool UseDefaultOutputForUnhandledMessages { get; set; }
Property Value
- bool
A value that indicates whether unhandled logging messages should get passed to the default SDL logging output
Methods
Critical(LogCategory, string)
Logs a message with Critical
public static void Critical(LogCategory category, string message)
Parameters
categoryLogCategoryThe category of the message
messagestringThe message to be logged
Remarks
The message parameter is treated as a C-style printf format string.
This means that any % characters are interpreted as format specifiers.
To include a literal % character in the output, you must escape it by writing %%.
Critical(LogCategory, string, params ReadOnlySpan<object>)
Logs a format string with Critical
public static void Critical(LogCategory category, string format, params ReadOnlySpan<object> args)
Parameters
categoryLogCategoryThe category of the message
formatstringThe C-style
printfformat stringargsReadOnlySpan<object>The arguments corresponding to the format specifiers in
format
Remarks
The format parameter is interpreted as a C-style printf format string, and
the args parameter supplies the values for its format specifiers. Supported argument
types include all integral types up to 64-bit (including bool and char),
floating point types (float and double), pointer types
(nint and nuint), and string.
For a detailed explanation of C-style printf format strings and their specifiers, see
https://en.wikipedia.org/wiki/Printf#Format_specifier.
Consider using Critical(LogCategory, string) instead when possible, as it may be more efficient. In many cases, you can use C# string interpolation to construct the message before logging.
Debug(LogCategory, string)
Logs a message with Debug
public static void Debug(LogCategory category, string message)
Parameters
categoryLogCategoryThe category of the message
messagestringThe message to be logged
Remarks
The message parameter is treated as a C-style printf format string.
This means that any % characters are interpreted as format specifiers.
To include a literal % character in the output, you must escape it by writing %%.
Debug(LogCategory, string, params ReadOnlySpan<object>)
Logs a format string with Debug
public static void Debug(LogCategory category, string format, params ReadOnlySpan<object> args)
Parameters
categoryLogCategoryThe category of the message
formatstringThe C-style
printfformat stringargsReadOnlySpan<object>The arguments corresponding to the format specifiers in
format
Remarks
The format parameter is interpreted as a C-style printf format string, and
the args parameter supplies the values for its format specifiers. Supported argument
types include all integral types up to 64-bit (including bool and char),
floating point types (float and double), pointer types
(nint and nuint), and string.
For a detailed explanation of C-style printf format strings and their specifiers, see
https://en.wikipedia.org/wiki/Printf#Format_specifier.
Consider using Debug(LogCategory, string) instead when possible, as it may be more efficient. In many cases, you can use C# string interpolation to construct the message before logging.
Error(LogCategory, string)
Logs a message with Error
public static void Error(LogCategory category, string message)
Parameters
categoryLogCategoryThe category of the message
messagestringThe message to be logged
Remarks
The message parameter is treated as a C-style printf format string.
This means that any % characters are interpreted as format specifiers.
To include a literal % character in the output, you must escape it by writing %%.
Error(LogCategory, string, params ReadOnlySpan<object>)
Logs a format string with Error
public static void Error(LogCategory category, string format, params ReadOnlySpan<object> args)
Parameters
categoryLogCategoryThe category of the message
formatstringThe C-style
printfformat stringargsReadOnlySpan<object>The arguments corresponding to the format specifiers in
format
Remarks
The format parameter is interpreted as a C-style printf format string, and
the args parameter supplies the values for its format specifiers. Supported argument
types include all integral types up to 64-bit (including bool and char),
floating point types (float and double), pointer types
(nint and nuint), and string.
For a detailed explanation of C-style printf format strings and their specifiers, see
https://en.wikipedia.org/wiki/Printf#Format_specifier.
Consider using Error(LogCategory, string) instead when possible, as it may be more efficient. In many cases, you can use C# string interpolation to construct the message before logging.
Info(LogCategory, string)
Logs a message with Info
public static void Info(LogCategory category, string message)
Parameters
categoryLogCategoryThe category of the message
messagestringThe message to be logged
Remarks
The message parameter is treated as a C-style printf format string.
This means that any % characters are interpreted as format specifiers.
To include a literal % character in the output, you must escape it by writing %%.
Info(LogCategory, string, params ReadOnlySpan<object>)
Logs a format string with Info
public static void Info(LogCategory category, string format, params ReadOnlySpan<object> args)
Parameters
categoryLogCategoryThe category of the message
formatstringThe C-style
printfformat stringargsReadOnlySpan<object>The arguments corresponding to the format specifiers in
format
Remarks
The format parameter is interpreted as a C-style printf format string, and
the args parameter supplies the values for its format specifiers. Supported argument
types include all integral types up to 64-bit (including bool and char),
floating point types (float and double), pointer types
(nint and nuint), and string.
For a detailed explanation of C-style printf format strings and their specifiers, see
https://en.wikipedia.org/wiki/Printf#Format_specifier.
Consider using Info(LogCategory, string) instead when possible, as it may be more efficient. In many cases, you can use C# string interpolation to construct the message before logging.
Info(string)
Logs a message with Application and Info
public static void Info(string message)
Parameters
messagestringThe message to be logged
Remarks
The message parameter is treated as a C-style printf format string.
This means that any % characters are interpreted as format specifiers.
To include a literal % character in the output, you must escape it by writing %%.
Info(string, params ReadOnlySpan<object>)
Logs a format string with Application and Info
public static void Info(string format, params ReadOnlySpan<object> args)
Parameters
formatstringThe C-style
printfformat stringargsReadOnlySpan<object>The arguments corresponding to the format specifiers in
format
Remarks
The format parameter is interpreted as a C-style printf format string, and
the args parameter supplies the values for its format specifiers. Supported argument
types include all integral types up to 64-bit (including bool and char),
floating point types (float and double), pointer types
(nint and nuint), and string.
For a detailed explanation of C-style printf format strings and their specifiers, see
https://en.wikipedia.org/wiki/Printf#Format_specifier.
Consider using Info(string) instead when possible, as it may be more efficient. In many cases, you can use C# string interpolation to construct the message before logging.
Message(LogCategory, LogPriority, string)
Logs a message with a specific category and priority
public static void Message(LogCategory category, LogPriority priority, string message)
Parameters
categoryLogCategoryThe category of the message
priorityLogPriorityThe priority of the message
messagestringThe message to be logged
Remarks
The message parameter is treated as a C-style printf format string.
This means that any % characters are interpreted as format specifiers.
To include a literal % character in the output, you must escape it by writing %%.
Message(LogCategory, LogPriority, string, params ReadOnlySpan<object>)
Logs a format string with a specific category and priority
public static void Message(LogCategory category, LogPriority priority, string format, params ReadOnlySpan<object> args)
Parameters
categoryLogCategoryThe category of the message
priorityLogPriorityThe priority of the message
formatstringThe C-style
printfformat stringargsReadOnlySpan<object>The arguments corresponding to the format specifiers in
format
Remarks
The format parameter is interpreted as a C-style printf format string, and
the args parameter supplies the values for its format specifiers. Supported argument
types include all integral types up to 64-bit (including bool and char),
floating point types (float and double), pointer types
(nint and nuint), and string.
For a detailed explanation of C-style printf format strings and their specifiers, see
https://en.wikipedia.org/wiki/Printf#Format_specifier.
Consider using Message(LogCategory, LogPriority, string) instead when possible, as it may be more efficient. In many cases, you can use C# string interpolation to construct the message before logging.
Trace(LogCategory, string)
Logs a message with Trace
public static void Trace(LogCategory category, string message)
Parameters
categoryLogCategoryThe category of the message
messagestringThe message to be logged
Remarks
The message parameter is treated as a C-style printf format string.
This means that any % characters are interpreted as format specifiers.
To include a literal % character in the output, you must escape it by writing %%.
Trace(LogCategory, string, params ReadOnlySpan<object>)
Logs a format string with Trace
public static void Trace(LogCategory category, string format, params ReadOnlySpan<object> args)
Parameters
categoryLogCategoryThe category of the message
formatstringThe C-style
printfformat stringargsReadOnlySpan<object>The arguments corresponding to the format specifiers in
format
Remarks
The format parameter is interpreted as a C-style printf format string, and
the args parameter supplies the values for its format specifiers. Supported argument
types include all integral types up to 64-bit (including bool and char),
floating point types (float and double), pointer types
(nint and nuint), and string.
For a detailed explanation of C-style printf format strings and their specifiers, see
https://en.wikipedia.org/wiki/Printf#Format_specifier.
Consider using Trace(LogCategory, string) instead when possible, as it may be more efficient. In many cases, you can use C# string interpolation to construct the message before logging.
Verbose(LogCategory, string)
Logs a message with Verbose
public static void Verbose(LogCategory category, string message)
Parameters
categoryLogCategoryThe category of the message
messagestringThe message to be logged
Remarks
The message parameter is treated as a C-style printf format string.
This means that any % characters are interpreted as format specifiers.
To include a literal % character in the output, you must escape it by writing %%.
Verbose(LogCategory, string, params ReadOnlySpan<object>)
Logs a format string with Verbose
public static void Verbose(LogCategory category, string format, params ReadOnlySpan<object> args)
Parameters
categoryLogCategoryThe category of the message
formatstringThe C-style
printfformat stringargsReadOnlySpan<object>The arguments corresponding to the format specifiers in
format
Remarks
The format parameter is interpreted as a C-style printf format string, and
the args parameter supplies the values for its format specifiers. Supported argument
types include all integral types up to 64-bit (including bool and char),
floating point types (float and double), pointer types
(nint and nuint), and string.
For a detailed explanation of C-style printf format strings and their specifiers, see
https://en.wikipedia.org/wiki/Printf#Format_specifier.
Consider using Verbose(LogCategory, string) instead when possible, as it may be more efficient. In many cases, you can use C# string interpolation to construct the message before logging.
Warn(LogCategory, string)
Logs a message with Warn
public static void Warn(LogCategory category, string message)
Parameters
categoryLogCategoryThe category of the message
messagestringThe message to be logged
Remarks
The message parameter is treated as a C-style printf format string.
This means that any % characters are interpreted as format specifiers.
To include a literal % character in the output, you must escape it by writing %%.
Warn(LogCategory, string, params ReadOnlySpan<object>)
Logs a format string with Warn
public static void Warn(LogCategory category, string format, params ReadOnlySpan<object> args)
Parameters
categoryLogCategoryThe category of the message
formatstringThe C-style
printfformat stringargsReadOnlySpan<object>The arguments corresponding to the format specifiers in
format
Remarks
The format parameter is interpreted as a C-style printf format string, and
the args parameter supplies the values for its format specifiers. Supported argument
types include all integral types up to 64-bit (including bool and char),
floating point types (float and double), pointer types
(nint and nuint), and string.
For a detailed explanation of C-style printf format strings and their specifiers, see
https://en.wikipedia.org/wiki/Printf#Format_specifier.
Consider using Warn(LogCategory, string) instead when possible, as it may be more efficient. In many cases, you can use C# string interpolation to construct the message before logging.
Events
Output
Raised for each logging message to be handled
public static event LogOutputEventHandler? Output