Example #1
0
        public void Info(FileInfo file, string message)
        {
            logs.Add(KeyValueLog.New(KeyValueLogType.Info, file, message));

            if (ShowProcess && OutputFilter != KeyValueLogType.Warning &&
                OutputFilter != KeyValueLogType.Error)
            {
                string fn = file != null ? file.FullName : "";
                $"INFO: {fn}".Out();
                message.Out();
            }
        }
Example #2
0
        public static KeyValueLog New(KeyValueLogType type, FileInfo file, string what)
        {
            var result = new KeyValueLog()
            {
                LogType = type,
                When    = DateTime.Now,
                File    = file,
                What    = what
            };

            return(result);
        }
Example #3
0
        public void Error(FileInfo file, string message)
        {
            Status = ProcessStatus.Errors;

            logs.Add(KeyValueLog.New(KeyValueLogType.Error, file, message));

            if (ShowProcess)
            {
                string fn = file != null ? file.FullName : "";
                $"ERROR: {fn}".OutRed();
                message.OutRed();
            }
        }
Example #4
0
        public void Warning(FileInfo file, string message)
        {
            if (Status == ProcessStatus.Ok)
            {
                Status = ProcessStatus.Warnings;
            }

            logs.Add(KeyValueLog.New(KeyValueLogType.Warning, file, message));

            if (ShowProcess && OutputFilter != KeyValueLogType.Error)
            {
                string fn = file != null ? file.FullName : "";
                $"WARNING: {fn}".OutYellow();
                message.OutYellow();
            }
        }