{"record":{"id":"1fae88647e39d799","repo":"ipfs/kubo","slug":"setting-log-level-s-w","errorCode":null,"errorMessage":"setting log level %s: %w","messagePattern":"setting log level (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/log.go","lineNumber":269,"sourceCode":"Example:\n\n  GOLOG_LOG_LEVEL=\"error,bitswap=debug\" ipfs daemon\n  ipfs log tail --log-level info\n\nThis will only return 'info' logs from bitswap and skip 'debug'.\n`,\n\t},\n\n\tOptions: []cmds.Option{\n\t\tcmds.StringOption(logLevelOption, \"Log level to listen to.\").WithDefault(\"\"),\n\t},\n\tRun: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {\n\t\tvar pipeReader *logging.PipeReader\n\t\tlogLevelString, _ := req.Options[logLevelOption].(string)\n\t\tif logLevelString != \"\" {\n\t\t\tlogLevel, err := logging.Parse(logLevelString)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"setting log level %s: %w\", logLevelString, err)\n\t\t\t}\n\t\t\tpipeReader = logging.NewPipeReader(logging.PipeLevel(logLevel))\n\t\t} else {\n\t\t\tpipeReader = logging.NewPipeReader()\n\t\t}\n\n\t\tgo func() {\n\t\t\t<-req.Context.Done()\n\t\t\tpipeReader.Close()\n\t\t}()\n\t\treturn res.Emit(pipeReader)\n\t},\n}\n","sourceCodeStart":251,"sourceCodeEnd":283,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/log.go#L251-L283","documentation":"Failure in `ipfs log level`: logging.Parse rejected the --log-level string (or the GOLOG_LOG_LEVEL-style subcomponent spec, e.g. 'error,bitswap=debug'). The value is not a recognized go-log level or level/subsystem pair, so no log level was changed.","triggerScenarios":"Thrown at core/commands/log.go:269 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a single valid level: debug, info, warn, error, dpanic, panic, or fatal","Use subsystem form like subsystem=level, e.g. bitswap=debug","Check GOLOG_LOG_LEVEL docs for the accepted syntax"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}