Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
BuildStepLogger.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;
4 
5 using SiliconStudio.Core.Diagnostics;
6 
7 namespace SiliconStudio.BuildEngine
8 {
9  public class BuildStepLogger : Logger
10  {
11  private readonly ILogger mainLogger;
13 
14  public BuildStepLogger(ILogger mainLogger, DateTime startTime)
15  {
16  this.mainLogger = mainLogger;
17  StepLogger = new TimestampLocalLogger(startTime);
18  // Let's receive all level messages, each logger will filter them itself
19  ActivateLog(LogMessageType.Debug);
20  // StepLogger messages will be forwarded to the monitor, which will also filter itself
21  StepLogger.ActivateLog(LogMessageType.Debug);
22  }
23 
24  protected override void LogRaw(ILogMessage logMessage)
25  {
26  if (mainLogger != null)
27  {
28  mainLogger.Log(logMessage);
29  }
30  if (StepLogger != null)
31  {
32  lock (StepLogger)
33  {
34  StepLogger.Log(logMessage);
35  }
36  }
37  }
38  }
39 }
BuildStepLogger(ILogger mainLogger, DateTime startTime)
readonly TimestampLocalLogger StepLogger
override void LogRaw(ILogMessage logMessage)
Internal method used to log a message. All Info, Debug, Error...etc. methods are calling this method...
Base implementation for ILogger.
Definition: Logger.cs:10
LogMessageType
Type of a LogMessage.
The base interface for log messages used by the logging infrastructure.
Definition: ILogMessage.cs:8
A logger that stores messages locally with their timestamp, useful for internal log scenarios...
Interface for logging.
Definition: ILogger.cs:8