Journal Class

Provides a logging mechanism, primarily for validation messages.

C#
public sealed class Journal
Inheritance
Journal

Constructors

Journal(string, ResourceManager, CultureInfo)

Initializes a new instance of the Journal class.

Properties

HasError

Gets a value indicating whether this logger has recorded any errors.

Methods

GetMessages()

Gets the collection of log messages representing the warnings and errors recorded by this logger.

Warn(string, object[])

Logs a warning message.

Error(string, object[])

Logs an error message and marks this logger to indicate that an error has been recorded.

Equals(object) (Inherited from object)
GetHashCode() (Inherited from object)
GetType() (Inherited from object)
MemberwiseClone() (Inherited from object)
ToString() (Inherited from object)

Constructors Detail

Journal(string, ResourceManager, CultureInfo)

Initializes a new instance of the Journal class.

C#
public Journal(string label, [ResourceManager maybeManager = null], [CultureInfo maybeCulture = null])

Parameters

label
string

The prefix for each log message.

maybeManager
ResourceManager

The resource manager to use for formatting messages, or null to use the default.

maybeCulture
CultureInfo

The culture to use for formatting messages, or null to use the current culture.

Properties Detail

HasError

Gets a value indicating whether this logger has recorded any errors.

C#
public bool HasError { get; private set; }

Property Value

Methods Detail

GetMessages()

Gets the collection of log messages representing the warnings and errors recorded by this logger.

C#
public IEnumerable<string> GetMessages()

Returns

A collection of log messages, including both warnings and errors, recorded by this logger.

Warn(string, object[])

Logs a warning message.

C#
public void Warn(string message, params object[] args)

Parameters

message
string

The resource key for the message format string.

args
object[]

The arguments for the formatted string.

Error(string, object[])

Logs an error message and marks this logger to indicate that an error has been recorded.

C#
public void Error(string message, params object[] args)

Parameters

message
string

The resource key for the message format string.

args
object[]

The arguments for the formatted string.