2016-09-27 09:32:39 -05:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2017-03-01 08:31:47 -06:00
|
|
|
if ( level <= ReportMessage.verbosity) {
|
2016-09-27 09:32:39 -05:00
|
|
|
Console.WriteLine(message);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Log(String message) {
|
|
|
|
Log(Verbosity.VeryVerbose,message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|