forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConsoleLogger.cs
37 lines (33 loc) · 1.4 KB
/
ConsoleLogger.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
using System;
using Microsoft.Xna.Framework.Content.Pipeline;
namespace MonoGame.Framework.Content.Pipeline.Builder
{
public class ConsoleLogger : ContentBuildLogger
{
public override void LogMessage(string message, params object[] messageArgs)
{
Console.WriteLine(IndentString + message, messageArgs);
}
public override void LogImportantMessage(string message, params object[] messageArgs)
{
// TODO: How do i make it high importance?
Console.WriteLine(IndentString + message, messageArgs);
}
public override void LogWarning(string helpLink, ContentIdentity contentIdentity, string message, params object[] messageArgs)
{
var warning = string.Empty;
if (contentIdentity != null && !string.IsNullOrEmpty(contentIdentity.SourceFilename))
{
warning = contentIdentity.SourceFilename;
if (!string.IsNullOrEmpty(contentIdentity.FragmentIdentifier))
warning += "(" + contentIdentity.FragmentIdentifier + ")";
warning += ": ";
}
warning += string.Format(message, messageArgs);
Console.WriteLine(warning);
}
}
}