Exemple #1
0
            public static APrint Factory(CLILogs.LogsLevel level, bool color)
            {
                switch (level)
                {
                case CLILogs.LogsLevel.Debug:
                    return(new Printer.Debug(color, new MessagePrinter(Console.Out)));

                case CLILogs.LogsLevel.Info:
                    return(new Printer.Info(color, new MessagePrinter(Console.Out)));

                case CLILogs.LogsLevel.Error:
                    return(new Printer.Error(color, new MessagePrinter(Console.Error)));

                case CLILogs.LogsLevel.Warning:
                    return(new Printer.Warning(color, new MessagePrinter(Console.Error)));

                case CLILogs.LogsLevel.Usage:
                    return(new Printer.Usage(color, new MessagePrinter(Console.Error)));

                case CLILogs.LogsLevel.Result:
                    return(new Printer.Result(color, new MessagePrinter(Console.Out)));

                default:
                    throw new NotImplementedException();
                }
            }
Exemple #2
0
 public static void CreateOneLogger(CLILogs.LogsLevel level)
 {
     if (Verbose <= level && level < LogsLevel.NoVerbose)
     {
         Logs[level] = Printer.PrinterFactory.Factory(level, !NoColor);
         CLILogs.Debug("Verbose set " + Enum.GetName(typeof(LogsLevel), level));
     }
 }