Skip to content

LogInstance ​

Instance-based wrapper for the static Log class, providing the same logging functionality.

Kind: Class

Namespace: CrowdControl.Common

Public Constructors

LogInstance()

Public Member Functions

void

Debug(object message)

Writes a debug message to the log.

void

Message(object message, bool omitTimestamp = false)

Writes a message to the log.

void

Message(object message, LogLevel level, bool omitTimestamp = false)

Writes a message to the log.

void

Error(object message, bool suppress = false)

Writes an error message to the log.

void

Error(Exception ex, bool suppress = false)

Writes an error message to the log.

void

Error(Exception ex, string message, bool suppress = false)

Writes an error message to the log.

void

PostEvent(object message, object source, string[] tags)

Posts a log event with the specified message, source, and tags.

void

PostEvent(object message, object source, LogLevel level, string[] tags)

Posts a log event with the specified message, source, and tags.

void

PostEvent(object message, object source, LogLevel level = Message, IEnumerable tags = null)

Posts a log event with the specified message, source, and tags.

void

PostEvent(string message, string source, LogLevel level = Message, IEnumerable tags = null)

Posts a log event with the specified message, source, and tags.

void

InvokeOnMessage(object message, LogLevel level, bool omitTimestamp = false)

Invokes the OnMessage event with the specified message and log level.

Public Attributes

string

OUTPUT_FOLDER

The name of the folder where log files are stored.

Properties

bool

IncludeTimestamps

[get, set]

Gets or sets whether timestamps should be included in log output.

bool

ConsoleOutput

[get, set]

Gets or sets whether logs should be written to the console.

bool

FileOutput

[get, set]

Gets or sets whether logs should be written to files.

static

int

SuppressionCount

[get, set]

Gets or sets the count of suppressed error messages.

Events

Action<string, LogLevel>

OnMessage

Event raised when a log message is written.

Action<Event>

EventPosted

Event raised when a log event is posted.