Show / Hide Table of Contents

Interface ILogger

Interface used by OpenTK to be able to log diagnostic information.

Namespace: OpenTK.Core.Utility
Assembly: OpenTK.Core.dll
Syntax
public interface ILogger

Properties

Filter

The filter level of the logger. Messages that are below the filter level will not be logged.

Declaration
LogLevel Filter { get; set; }
Property Value
Type Description
LogLevel

Methods

Flush()

Flushes any pending IO operations. This is useful when e.g. the application is terminating and the final log messages containing the termination reason needs to be written.

Declaration
void Flush()

Log(string, LogLevel, string, int, string)

Logs a message with a specific logging level.

Declaration
void Log(string str, LogLevel level, string filePath = null, int line = -1, string member = null)
Parameters
Type Name Description
string str

The string to log.

LogLevel level

The logging level.

string filePath

The callsite file name.

int line

The callsite line number.

string member

The member name at the callsite.

LogDebug(string, string, int, string)

Logs a debug message.

Declaration
void LogDebug(string str, string filePath = null, int line = -1, string member = null)
Parameters
Type Name Description
string str

The debug string to log.

string filePath

The callsite file name.

int line

The callsite line number.

string member

The member name at the callsite.

LogError(string, string, int, string)

Logs an error.

Declaration
void LogError(string str, string filePath = null, int line = -1, string member = null)
Parameters
Type Name Description
string str

The error to log.

string filePath

The callsite file name.

int line

The callsite line number.

string member

The member name at the callsite.

LogInfo(string, string, int, string)

Log a message.

Declaration
void LogInfo(string str, string filePath = null, int line = -1, string member = null)
Parameters
Type Name Description
string str

The message to log.

string filePath

The callsite file name.

int line

The callsite line number.

string member

The member name at the callsite.

LogInternal(string, LogLevel, string, int, string)

The internal logging function. An implementor only need to implement this function. The implementation needs to take into consideration Filter when logging.

Declaration
void LogInternal(string str, LogLevel level, string filePath, int lineNumber, string member)
Parameters
Type Name Description
string str

The string to log.

LogLevel level

The logging level.

string filePath

The callsite file name.

int lineNumber

The callsite line number.

string member

The member name at the callsite.

LogWarning(string, string, int, string)

Logs a warning.

Declaration
void LogWarning(string str, string filePath = null, int line = -1, string member = null)
Parameters
Type Name Description
string str

The warning to log.

string filePath

The callsite file name.

int line

The callsite line number.

string member

The member name at the callsite.

In this article
Back to top Generated by DocFX