Uniglot/CSharp/ReportMessage.csharp
2017-03-01 08:31:47 -06:00

40 lines
715 B
Plaintext

using System;
namespace AniNIX.Shared {
public enum Verbosity {
Always = -2,
Error,
Quiet = 0,
Verbose,
VeryVerbose,
Explicit,
}
public static class ReportMessage {
// Set this statically here, but allow others to override.
public static Verbosity verbosity = Verbosity.Quiet;
/// <summary>
/// Log a new message for the user.
/// </summary>
public static void Log(Verbosity level,String message) {
if (level == Verbosity.Error) {
Console.Error.WriteLine(message);
return;
}
if ( level <= ReportMessage.verbosity) {
Console.WriteLine(message);
}
}
public static void Log(String message) {
Log(Verbosity.VeryVerbose,message);
}
}
}