Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
DebugLogListener.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System.Diagnostics;
4 
5 namespace SiliconStudio.Core.Diagnostics
6 {
7  /// <summary>
8  /// A <see cref="LogListener"/> implementation redirecting its output to a <see cref="Debug"/>.
9  /// </summary>
11  {
12  protected override void OnLog(ILogMessage logMessage)
13  {
14  Debug.WriteLine(GetDefaultText(logMessage));
15  var exceptionMsg = GetExceptionText(logMessage);
16  if (!string.IsNullOrEmpty(exceptionMsg))
17  {
18  Debug.WriteLine(exceptionMsg);
19  }
20  }
21  }
22 }
override void OnLog(ILogMessage logMessage)
Called when a log occurred.
A base class to implement a log listener
Definition: LogListener.cs:10
The base interface for log messages used by the logging infrastructure.
Definition: ILogMessage.cs:8
A LogListener implementation redirecting its output to a Debug.