anx.framework/ANX.Framework.Content.Pipeline/ConsoleContentBuildLogger.cs
Konstantin Koch a8588a30a5 Update ContentCompiler, make Visual Studio Extension work without having Anx Framework installed.
Make ContentCompilerGui compatible to recent changes in pipeline and did
some usability changes.
Make the Visual Studio Extension work even if the ANX Framework is not
installed additionally..
Improve that the path for assembly refernces in a content project
doesn't get automatically updated, only if the reference is actually
saved, this is so you can specify a relative path yourself.
Fix missing icon for ContentProject when it was opened with Visual
Studio.
Made create_shaders.bat directly executable under windows by fixing the
directory separators.
2015-09-03 23:43:55 +02:00

58 lines
2.1 KiB
C#

#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ANX.Framework.Content.Pipeline;
using ANX.Framework.NonXNA.Development;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
[Developer("KorsarNek")]
public class ConsoleContentBuildLogger : ContentBuildLogger
{
public override void LogImportantMessage(string message, params object[] messageArgs)
{
var previousColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Blue;
Write("Important", message, messageArgs);
Console.ForegroundColor = previousColor;
}
public override void LogImportantMessage(string helpLink, ContentIdentity contentIdentity, string message, params object[] messageArgs)
{
var previousColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Blue;
Write("Important", message, messageArgs);
Console.ForegroundColor = previousColor;
}
public override void LogMessage(string message, params object[] messageArgs)
{
var previousColor = Console.ForegroundColor;
Console.ResetColor();
Write("Info", message, messageArgs);
Console.ForegroundColor = previousColor;
}
public override void LogWarning(string helpLink, ContentIdentity contentIdentity, string message, params object[] messageArgs)
{
var previousColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Yellow;
Write("Warning", message, messageArgs);
Console.ForegroundColor = previousColor;
}
private void Write(string severity, string message, params object[] messageArgs)
{
Console.WriteLine(String.Format("[{0}] {1}", severity, String.Format(message, messageArgs)));
}
}
}