public ConsoleLogger(
     Func <Diagnostic, string> format = null,
     DiagnosticSeverity verbosity     = DiagnosticSeverity.Hint,
     IEnumerable <int> noWarn         = null,
     int lineNrOffset = 0)
     : base(verbosity, noWarn, lineNrOffset) =>
     this.applyFormatting = format ?? Formatting.HumanReadableFormat;
예제 #2
0
        private static DiagnosticSeverity ToDiagnosticSeverity(LSP.DiagnosticSeverity severity)
        {
            switch (severity)
            {
            case LSP.DiagnosticSeverity.Error:
                return(DiagnosticSeverity.Error);

            case LSP.DiagnosticSeverity.Warning:
                return(DiagnosticSeverity.Warning);

            case LSP.DiagnosticSeverity.Information:
                return(DiagnosticSeverity.Info);

            case LSP.DiagnosticSeverity.Hint:
                return(DiagnosticSeverity.Hidden);

            default:
                throw new InvalidOperationException("Unknown severity");
            }
        }
예제 #3
0
        public static LogLevel MapLevel(LSP.DiagnosticSeverity original)
        {
            switch (original)
            {
            case LSP.DiagnosticSeverity.Error:
                return(LogLevel.Error);

            case LSP.DiagnosticSeverity.Warning:
                return(LogLevel.Warning);

            case LSP.DiagnosticSeverity.Information:
                return(LogLevel.Information);

            case LSP.DiagnosticSeverity.Hint:
                return(LogLevel.Debug);

            default:
                return(LogLevel.Trace);
            }
        }