Journal Class
Provides a logging mechanism, primarily for validation messages.
public sealed class Journal
- Inheritance
-
Journal
Constructors
Journal(string, Resource |
Initializes a new instance of the Journal class. |
Properties
Has |
Gets a value indicating whether this logger has recorded any errors. |
Methods
Get |
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.
public Journal(string label, [ResourceManager maybeManager = null], [CultureInfo maybeCulture = null])
Parameters
- label
- string
The prefix for each log message.
- maybeManager
-
Resource
Manager
The resource manager to use for formatting messages, or null
to
use the default.
- maybeCulture
-
Culture
Info
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.
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.
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.
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.
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.