Click or drag to resize
ILog Interface
The interface for objects that can manage log files for us.

Namespace: VirtualRadar.Interface
Assembly: VirtualRadar.Interface (in VirtualRadar.Interface.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public interface ILog : ISingleton<ILog>

The ILog type exposes the following members.

Properties
  NameDescription
Public propertyFileName
Gets the full path and filename of the log file.
Public propertyProvider
Gets or sets the provider that abstracts away the environment for the tests.
Public propertySingleton
Gets the single instance of the class that should be used throughout the application.
(Inherited from ISingletonT.)
Top
Methods
  NameDescription
Public methodGetContent
Returns the content of the log as an array of lines, optionally truncated to the last so-many lines.
Public methodTruncate
Truncates the log file to the last nn kilobytes.
Public methodWriteLine(String)
Writes a line of text to the log file.
Public methodWriteLine(String, Object)
Writes a line of text to the log file.
Top
Remarks
You should only use the Singleton version of this object to write to the program log. Using your own instance will work but it will not be thread-safe whereas the Singleton log is guaranteed to be thread-safe.
Examples
ILog log = Factory.Singleton.Resolve<ILog>().Singleton;
log.WriteLine("This will be written to the program log");
See Also