Class Log
Wrapper for message logging functions.
Inheritance
Inherited Members
Namespace: NetVips
Assembly: NetVips.dll
Syntax
public static class Log
Methods
| Improve this Doc View SourcePrintLogFunction(String, Enums.LogLevelFlags, String)
Common logging method.
Declaration
public static void PrintLogFunction(string domain, Enums.LogLevelFlags level, string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | domain | The log domain of the message. |
Enums.LogLevelFlags | level | The log level of the message (including the fatal and recursion flags). |
System.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, Enums.LogLevelFlags, String)
Common logging method.
Declaration
public static void PrintTraceLogFunction(string domain, Enums.LogLevelFlags level, string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | domain | The log domain of the message. |
Enums.LogLevelFlags | level | The log level of the message (including the fatal and recursion flags). |
System.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, UInt32)
Removes the log handler.
Declaration
public static void RemoveLogHandler(string logDomain, uint handlerId)
Parameters
Type | Name | Description |
---|---|---|
System.String | logDomain | The log domain. |
System.UInt32 | handlerId | The id of the handler, which was returned in SetLogHandler(String, Enums.LogLevelFlags, Log.LogDelegate). |
SetAlwaysFatal(Enums.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, Enums.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 |
---|---|---|
System.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, Enums.LogLevelFlags, Log.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 |
---|---|---|
System.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 |
---|---|
System.UInt32 | The id of the handler. |