Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleHandler_levelHandler (0.47 sec)

  1. src/log/slog/example_level_handler_test.go

    // output.
    //
    // Another typical use would be to decrease the log level (to LevelDebug, say)
    // during a part of the program that was suspected of containing a bug.
    func ExampleHandler_levelHandler() {
    	th := slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{ReplaceAttr: slogtest.RemoveTime})
    	logger := slog.New(NewLevelHandler(slog.LevelWarn, th))
    	logger.Info("not printed")
    	logger.Warn("printed")
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 04 18:32:54 UTC 2023
    - 2.2K bytes
    - Viewed (0)
Back to top