TSdlLog
Logging functionality.
Definition
Unit: Neslib.Sdl3.Basics
Properties
Name | Description |
---|---|
CustomOutputFunction | A custom log output function, or nil to use the default log function. |
Priorities | The priorities of log categories. |
Constructors
Name | Description |
---|---|
Create |
Methods
Name | Description |
---|---|
Critical(String, const[], TSdlLogCategory) | Log a message with TSdlLogPriority.Critical. |
Critical(String, TSdlLogCategory) | Log a message with TSdlLogPriority.Critical. |
Debug(String, const[], TSdlLogCategory) | Log a message with TSdlLogPriority.Debug. |
Debug(String, TSdlLogCategory) | Log a message with TSdlLogPriority.Debug. |
Error(String, const[], TSdlLogCategory) | Log a message with TSdlLogPriority.Error. |
Error(String, TSdlLogCategory) | Log a message with TSdlLogPriority.Error. |
Info(String, const[], TSdlLogCategory) | Log a message with TSdlLogCategory.Application and TSdlLogPriority.Info. |
Info(String, TSdlLogCategory) | Log a message with TSdlLogCategory.Application and TSdlLogPriority.Info. |
Message(TSdlLogCategory, TSdlLogPriority, String, const[]) | Log a message with the specified category and priority. |
Message(TSdlLogCategory, TSdlLogPriority, String) | Log a message with the specified category and priority. |
ResetPriorities | Reset all priorities to default. |
SetAllPriorities | Set the priority of all log categories. |
SetPriorityPrefix | Set the text prepended to log messages of a given priority. |
Trace(String, const[], TSdlLogCategory) | Log a message with TSdlLogPriority.Trace. |
Trace(String, TSdlLogCategory) | Log a message with TSdlLogPriority.Trace. |
Verbose(String, const[], TSdlLogCategory) | Log a message with TSdlLogPriority.Verbose. |
Verbose(String, TSdlLogCategory) | Log a message with TSdlLogPriority.Verbose. |
Warn(String, const[], TSdlLogCategory) | Log a message with TSdlLogPriority.Warn. |
Warn(String, TSdlLogCategory) | Log a message with TSdlLogPriority.Warn. |
Property Descriptions
CustomOutputFunction
A custom log output function, or nil to use the default log function.
Note that using a custom log output function can impact performance, especially when a lot of messages are logged (for example, when using a log log priority).
class property CustomOutputFunction: TSdlLogOutputFunction read FCustomOutputFunction write SetCustomOutputFunction
Type: TSdlLogOutputFunction
Remarks
It is safe to use this property from any thread.
Priorities
The priorities of log categories.
class property Priorities[const ACategory: TSdlLogCategory]: TSdlLogPriority read GetPriority write SetPriority
Type: TSdlLogPriority
See Also
Remarks
It is safe to use this property from any thread.
Constructor Descriptions
Create
class constructor Create
Method Descriptions
Critical(String, const[], TSdlLogCategory)
Log a message with TSdlLogPriority.Critical.
class procedure Critical(const AMessage: String; const AArgs: array of const; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; static
Parameters
AMessage
: String
: The message
AArgs
: array of const
: Additional arguments matching the format specifiers.
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Critical(String, TSdlLogCategory)
Log a message with TSdlLogPriority.Critical.
class procedure Critical(const AMessage: String; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; inline; static
Parameters
AMessage
: String
: The message
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Debug(String, const[], TSdlLogCategory)
Log a message with TSdlLogPriority.Debug.
class procedure Debug(const AMessage: String; const AArgs: array of const; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; static
Parameters
AMessage
: String
: The message
AArgs
: array of const
: Additional arguments matching the format specifiers.
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Debug(String, TSdlLogCategory)
Log a message with TSdlLogPriority.Debug.
class procedure Debug(const AMessage: String; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; inline; static
Parameters
AMessage
: String
: The message
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Error(String, const[], TSdlLogCategory)
Log a message with TSdlLogPriority.Error.
class procedure Error(const AMessage: String; const AArgs: array of const; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; static
Parameters
AMessage
: String
: The message
AArgs
: array of const
: Additional arguments matching the format specifiers.
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Error(String, TSdlLogCategory)
Log a message with TSdlLogPriority.Error.
class procedure Error(const AMessage: String; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; inline; static
Parameters
AMessage
: String
: The message
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Info(String, const[], TSdlLogCategory)
Log a message with TSdlLogCategory.Application and TSdlLogPriority.Info.
class procedure Info(const AMessage: String; const AArgs: array of const; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; static
Parameters
AMessage
: String
: The message with format specifiers.
AArgs
: array of const
: Additional arguments matching the format specifiers.
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Info(String, TSdlLogCategory)
Log a message with TSdlLogCategory.Application and TSdlLogPriority.Info.
class procedure Info(const AMessage: String; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; inline; static
Parameters
AMessage
: String
: The message
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Message(TSdlLogCategory, TSdlLogPriority, String, const[])
Log a message with the specified category and priority.
class procedure Message(const ACategory: TSdlLogCategory; const APriority: TSdlLogPriority; const AMessage: String; const AArgs: array of const); overload; static
Parameters
ACategory
: TSdlLogCategory
: The category of the message.
APriority
: TSdlLogPriority
: The priority of the message.
AMessage
: String
: The message
AArgs
: array of const
: Additional arguments matching the format specifiers.
Remarks
It is safe to call this method from any thread.
Message(TSdlLogCategory, TSdlLogPriority, String)
Log a message with the specified category and priority.
class procedure Message(const ACategory: TSdlLogCategory; const APriority: TSdlLogPriority; const AMessage: String); overload; inline; static
Parameters
ACategory
: TSdlLogCategory
: The category of the message.
APriority
: TSdlLogPriority
: The priority of the message.
AMessage
: String
: The message
Remarks
It is safe to call this method from any thread.
ResetPriorities
Reset all priorities to default.
This is called by SdlQuit.
class procedure ResetPriorities; static
See Also
Remarks
It is safe to call this method from any thread.
SetAllPriorities(TSdlLogPriority)
Set the priority of all log categories.
class procedure SetAllPriorities(const APriority: TSdlLogPriority); static
Parameters
APriority
: TSdlLogPriority
: The TSdlLogPriority to assign.
See Also
Remarks
It is safe to call this method from any thread.
SetPriorityPrefix(TSdlLogPriority, String)
Set the text prepended to log messages of a given priority.
By default TSdlLogPriority.Info and below have no prefix, and TSdlLogPriority.Warn and higher have a prefix showing their priority, e.g. 'WARNING: '.
class procedure SetPriorityPrefix(const APriority: TSdlLogPriority; const APrefix: String); static
Exceptions
ESdlError
: Raised on failure.
Parameters
APriority
: TSdlLogPriority
: The TSdlLogPriority to modify.
APrefix
: String
: The prefix to use for that log priority, or an empty string to use no prefix.
See Also
Remarks
It is safe to call this method from any thread.
Trace(String, const[], TSdlLogCategory)
Log a message with TSdlLogPriority.Trace.
class procedure Trace(const AMessage: String; const AArgs: array of const; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; static
Parameters
AMessage
: String
: The message
AArgs
: array of const
: Additional arguments matching the format specifiers.
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Trace(String, TSdlLogCategory)
Log a message with TSdlLogPriority.Trace.
class procedure Trace(const AMessage: String; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; inline; static
Parameters
AMessage
: String
: The message
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Verbose(String, const[], TSdlLogCategory)
Log a message with TSdlLogPriority.Verbose.
class procedure Verbose(const AMessage: String; const AArgs: array of const; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; static
Parameters
AMessage
: String
: The message
AArgs
: array of const
: Additional arguments matching the format specifiers.
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Verbose(String, TSdlLogCategory)
Log a message with TSdlLogPriority.Verbose.
class procedure Verbose(const AMessage: String; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; inline; static
Parameters
AMessage
: String
: The message
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Warn(String, const[], TSdlLogCategory)
Log a message with TSdlLogPriority.Warn.
class procedure Warn(const AMessage: String; const AArgs: array of const; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; static
Parameters
AMessage
: String
: The message
AArgs
: array of const
: Additional arguments matching the format specifiers.
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.
Warn(String, TSdlLogCategory)
Log a message with TSdlLogPriority.Warn.
class procedure Warn(const AMessage: String; const ACategory: TSdlLogCategory = TSdlLogCategory.Application); overload; inline; static
Parameters
AMessage
: String
: The message
ACategory
: TSdlLogCategory = TSdlLogCategory.Application
: (Optional) category. Defaults to Application.
Remarks
It is safe to call this method from any thread.