Table of Contents

Class SessionLogger

Namespace
Hi.Common
Assembly
HiGeom.dll

Provides logging functionality for sessions with file output capabilities.

public class SessionLogger : IDisposable, IMakeXmlSource
Inheritance
SessionLogger
Implements
Inherited Members
Extension Methods

Constructors

SessionLogger()

Initializes a new instance of the SessionLogger class.

public SessionLogger()

SessionLogger(XElement)

Initializes a new instance of the SessionLogger class from an XML element.

public SessionLogger(XElement src)

Parameters

src XElement

The XML element containing the logger configuration

Fields

XName

Gets the XML element name used for serialization.

public static string XName

Field Value

string

Properties

SessionPath

Gets the actual path of the current session log file.

public string SessionPath { get; }

Property Value

string

SessionPathFormat

Gets or sets the format string for the session log file path.

public string SessionPathFormat { get; set; }

Property Value

string

Methods

Add(string)

Adds a message to the session log.

public void Add(string msg)

Parameters

msg string

The message to add to the log

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

MakeXmlSource(string, string)

Creates an XML representation of the object. This method may also generate additional resources such as related files.

public XElement MakeXmlSource(string baseDirectory, string relFile)

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

Returns

XElement

An XML element representing the object's state

Prepare()

Prepare for the performance of first call of Add(string).

public void Prepare()

Reset()

Resets the logger, closing the current log file and triggering the session end event.

public void Reset()

Events

MessageEventHandler

Event triggered when a message is added to the log.

public event EventHandler<string> MessageEventHandler

Event Type

EventHandler<string>

SessionEndEventHandler

Event triggered when the session ends.

public event EventHandler SessionEndEventHandler

Event Type

EventHandler