Logger Warning Method (Exception)Delta Engine Documentation
If something bad happened and we caught a non fatal exception this message is logged. View code on GitHub

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

public static void Warning(
	Exception exception
)
Remarks

Tests: DeltaEngine.Tests.Core.LoggerTests
Examples

2 unit tests call DeltaEngine.Core.Logger.Warning(System.Exception)
[Test]
public void LogWarning()
{
    using (var logger = new MockLogger())
    {
        Logger.Warning("Ohoh");
        Assert.AreEqual("Ohoh", logger.LastMessage);
        Logger.Warning(new NullReferenceException());
        Assert.IsTrue(logger.LastMessage.Contains("NullReferenceException"));
    }
}
[Test]
public void IfNoLoggerIsAttachedWeGetAWarning()
{
    const string Warning = "Ohoh";
    const string Message = "No loggers have been created for this message: " + Warning;
    var defaultOut = Console.Out;
    var console = new StringWriter();
    Console.SetOut(console);
    Logger.Warning(Warning);
    Assert.IsTrue(console.ToString().Contains(Message), console.ToString());
    Console.SetOut(defaultOut);
    console.Dispose();
}
See Also