[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / tools / mono-symbolicate / Logger.cs
blob4dd1174a208f387822cbefc9b4131781ded52a91
1 using System;
3 namespace Mono
5 public class Logger
7 public enum Level
9 Debug = 1,
10 Warning = 2,
11 Error = 3,
12 None = 4,
15 Level level;
16 Action<string> logAction;
18 public Logger (Level level, Action<string> logAction)
20 this.level = level;
21 this.logAction = logAction;
24 public void LogDebug (string str, params string[] vals)
26 Log (Level.Debug, "Debug: " + str, vals);
29 public void LogWarning (string str, params string[] vals)
31 Log (Level.Warning, "Warning: " + str, vals);
34 public void LogError (string str, params string[] vals)
36 Log (Level.Error, "Error: " + str, vals);
39 private void Log (Level msgLevel, string str, params string[] vals)
41 if ((int) level > (int) msgLevel)
42 return;
44 logAction (string.Format (str, vals));