TextFileLogger ClassDelta Engine Documentation
Writes into a log text file and opens it in a editor after execution. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Core Logger
    DeltaEngine.Logging TextFileLogger

Namespace: DeltaEngine.Logging
Assembly: DeltaEngine.Logging (in DeltaEngine.Logging.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class TextFileLogger : Logger

The TextFileLogger type exposes the following members.

Constructors

  NameDescription
Public methodTextFileLogger
Initializes a new instance of the TextFileLogger class
Top
Methods

  NameDescription
Protected methodCreateMessageTypePrefix (Inherited from Logger.)
Public methodDispose
Releases all resources used by the TextFileLogger
(Overrides Logger Dispose .)
Public methodWrite (Overrides Logger Write(Logger MessageType, String).)
Top
Properties

  NameDescription
Public propertyLastMessage (Inherited from Logger.)
Public propertyNumberOfRepeatedMessagesIgnored (Inherited from Logger.)
Top
Remarks

Tests: DeltaEngine.Logging.Tests.TextFileLoggerTests
Examples

5 unit tests call DeltaEngine.Logging.TextFileLogger
[Test]
public void WhenThereWasNoLoggingNoFileIsCreated()
{
    Assert.IsFalse(File.Exists(LogFilePath));
}
[Test]
public void LogInfoAndOpenFile()
{
    logger.Write(Logger.MessageType.Info, "Test for logging info");
}
[Test]
public void LogTwoMessagesAndOpenFile()
{
    logger.Write(Logger.MessageType.Info, "Info message 1");
    logger.Write(Logger.MessageType.Info, "Info message 2");
}
See Also