Class Log
Wrapper for message logging functions.
Inherited Members
Namespace: NetVips
Assembly: NetVips.dll
Syntax
public static class Log
Methods
PrintLogFunction(string, LogLevelFlags, string)
Common logging method.
Declaration
public static void PrintLogFunction(string domain, Enums.LogLevelFlags level, string message)
Parameters
Type | Name | Description |
---|---|---|
string | domain | The log domain of the message. |
Enums.LogLevelFlags | level | The log level of the message (including the fatal and recursion flags). |
string | message | The message to process. |
Remarks
Sample usage:
// Print the messages for the NULL domain
var logFunc = new LogFunc(Log.PrintLogFunction);
Log.SetLogHandler(null, Enums.LogLevelFlags.All, logFunc);
PrintTraceLogFunction(string, LogLevelFlags, string)
Common logging method.
Declaration
public static void PrintTraceLogFunction(string domain, Enums.LogLevelFlags level, string message)
Parameters
Type | Name | Description |
---|---|---|
string | domain | The log domain of the message. |
Enums.LogLevelFlags | level | The log level of the message (including the fatal and recursion flags). |
string | message | The message to process. |
Remarks
Sample usage:
// Print messages and stack trace for vips critical messages
var logFunc = new LogFunc(Log.PrintTraceLogFunction);
Log.SetLogHandler("VIPS", Enums.LogLevelFlags.Critical, logFunc);
RemoveLogHandler(string, uint)
Removes the log handler.
Declaration
public static void RemoveLogHandler(string logDomain, uint handlerId)
Parameters
Type | Name | Description |
---|---|---|
string | logDomain | The log domain. |
uint | handlerId | The id of the handler, which was returned in SetLogHandler(string, LogLevelFlags, LogDelegate). |
SetAlwaysFatal(LogLevelFlags)
Sets the message levels which are always fatal, in any log domain. When a message with any of these levels is logged the program terminates.
Declaration
public static Enums.LogLevelFlags SetAlwaysFatal(Enums.LogLevelFlags fatalMask)
Parameters
Type | Name | Description |
---|---|---|
Enums.LogLevelFlags | fatalMask | The mask containing bits set for each level of error which is to be fatal. |
Returns
Type | Description |
---|---|
Enums.LogLevelFlags | The old fatal mask. |
SetAlwaysFatal(string, LogLevelFlags)
Sets the log levels which are fatal in the given domain.
Declaration
public static Enums.LogLevelFlags SetAlwaysFatal(string logDomain, Enums.LogLevelFlags fatalMask)
Parameters
Type | Name | Description |
---|---|---|
string | logDomain | The log domain. |
Enums.LogLevelFlags | fatalMask | The new fatal mask. |
Returns
Type | Description |
---|---|
Enums.LogLevelFlags | The old fatal mask for the log domain. |
SetLogHandler(string, LogLevelFlags, LogDelegate)
Sets the log handler for a domain and a set of log levels.
Declaration
public static uint SetLogHandler(string logDomain, Enums.LogLevelFlags flags, Log.LogDelegate logFunc)
Parameters
Type | Name | Description |
---|---|---|
string | logDomain | The log domain, or null for the default "" application domain. |
Enums.LogLevelFlags | flags | The log levels to apply the log handler for. |
Log.LogDelegate | logFunc | The log handler function. |
Returns
Type | Description |
---|---|
uint | The id of the handler. |