Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for LevelError (0.7 sec)

  1. src/log/slog/level_test.go

    	"bytes"
    	"flag"
    	"strings"
    	"testing"
    )
    
    func TestLevelString(t *testing.T) {
    	for _, test := range []struct {
    		in   Level
    		want string
    	}{
    		{0, "INFO"},
    		{LevelError, "ERROR"},
    		{LevelError + 2, "ERROR+2"},
    		{LevelError - 2, "WARN+2"},
    		{LevelWarn, "WARN"},
    		{LevelWarn - 1, "INFO+3"},
    		{LevelInfo, "INFO"},
    		{LevelInfo + 1, "INFO+1"},
    		{LevelInfo - 3, "DEBUG+1"},
    		{LevelDebug, "DEBUG"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 20:44:14 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. tools/bug-report/pkg/processlog/processlog.go

    		_, level, text, valid := parseLog(l)
    		if !valid {
    			continue
    		}
    		switch level {
    		case levelFatal, levelError, levelWarn:
    			if match.MatchesGlobs(text, config.IgnoredErrors) {
    				continue
    			}
    			switch level {
    			case levelFatal:
    				out.numFatals++
    			case levelError:
    				out.numErrors++
    			case levelWarn:
    				out.numWarnings++
    			}
    		default:
    		}
    	}
    	return out
    }
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 19 21:44:33 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  3. src/log/slog/level.go

    	}
    
    	switch {
    	case l < LevelInfo:
    		return str("DEBUG", l-LevelDebug)
    	case l < LevelWarn:
    		return str("INFO", l-LevelInfo)
    	case l < LevelError:
    		return str("WARN", l-LevelWarn)
    	default:
    		return str("ERROR", l-LevelError)
    	}
    }
    
    // MarshalJSON implements [encoding/json.Marshaler]
    // by quoting the output of [Level.String].
    func (l Level) MarshalJSON() ([]byte, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 30 17:34:43 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  4. src/log/slog/example_log_level_test.go

    // of the internal writer that uses the custom handler for log package after
    // calling slog.SetDefault.
    func ExampleSetLogLoggerLevel_slog() {
    	// Set the default logging level to slog.LevelError.
    	currentLogLevel := slog.SetLogLoggerLevel(slog.LevelError)
    	defer slog.SetLogLoggerLevel(currentLogLevel) // revert changes after the example
    
    	defer slog.SetDefault(slog.Default()) // revert changes after the example
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 10 21:25:30 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  5. src/log/slog/example_custom_levels_test.go

    	const (
    		LevelTrace     = slog.Level(-8)
    		LevelDebug     = slog.LevelDebug
    		LevelInfo      = slog.LevelInfo
    		LevelNotice    = slog.Level(2)
    		LevelWarning   = slog.LevelWarn
    		LevelError     = slog.LevelError
    		LevelEmergency = slog.Level(12)
    	)
    
    	th := slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
    		// Set a custom level to show all log output. The default value is
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 11 17:06:26 UTC 2023
    - 3K bytes
    - Viewed (0)
Back to top