You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
48
mcs/tools/mono-symbolicate/Logger.cs
Normal file
48
mcs/tools/mono-symbolicate/Logger.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
|
||||
namespace Mono
|
||||
{
|
||||
public class Logger
|
||||
{
|
||||
public enum Level
|
||||
{
|
||||
Debug = 1,
|
||||
Warning = 2,
|
||||
Error = 3,
|
||||
None = 4,
|
||||
}
|
||||
|
||||
Level level;
|
||||
Action<string> logAction;
|
||||
|
||||
public Logger (Level level, Action<string> logAction)
|
||||
{
|
||||
this.level = level;
|
||||
this.logAction = logAction;
|
||||
}
|
||||
|
||||
public void LogDebug (string str, params string[] vals)
|
||||
{
|
||||
Log (Level.Debug, "Debug: " + str, vals);
|
||||
}
|
||||
|
||||
public void LogWarning (string str, params string[] vals)
|
||||
{
|
||||
Log (Level.Warning, "Warning: " + str, vals);
|
||||
}
|
||||
|
||||
public void LogError (string str, params string[] vals)
|
||||
{
|
||||
Log (Level.Error, "Error: " + str, vals);
|
||||
}
|
||||
|
||||
private void Log (Level msgLevel, string str, params string[] vals)
|
||||
{
|
||||
if ((int) level > (int) msgLevel)
|
||||
return;
|
||||
|
||||
logAction (string.Format (str, vals));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user