{"record":{"id":"994996043920f988","repo":"Yeachan-Heo/oh-my-codex","slug":"log-level-must-be-one-of-error-info-debug","errorCode":null,"errorMessage":"`log_level` must be one of: error, info, debug","messagePattern":"`log_level` must be one of: error, info, debug","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/tmux-hook.ts","lineNumber":156,"sourceCode":"  }\n  if (typeof maxInjections !== 'number' || maxInjections < 1 || !Number.isFinite(maxInjections)) {\n    throw new Error('`max_injections_per_session` must be >= 1');\n  }\n\n  const promptTemplate = parsed.prompt_template;\n  const marker = parsed.marker;\n  if (typeof promptTemplate !== 'string' || promptTemplate.trim() === '') {\n    throw new Error('`prompt_template` must be a non-empty string');\n  }\n  if (typeof marker !== 'string' || marker.trim() === '') {\n    throw new Error('`marker` must be a non-empty string');\n  }\n\n  if (parsed.dry_run !== true && parsed.dry_run !== false) {\n    throw new Error('`dry_run` must be boolean');\n  }\n  if (parsed.log_level !== 'error' && parsed.log_level !== 'info' && parsed.log_level !== 'debug') {\n    throw new Error('`log_level` must be one of: error, info, debug');\n  }\n  if (parsed.skip_if_scrolling !== undefined && parsed.skip_if_scrolling !== true && parsed.skip_if_scrolling !== false) {\n    throw new Error('`skip_if_scrolling` must be boolean');\n  }\n\n  return {\n    enabled: parsed.enabled,\n    target: { type: targetObj.type, value: targetObj.value },\n    allowed_modes: allowedModes,\n    cooldown_ms: cooldown,\n    max_injections_per_session: maxInjections,\n    prompt_template: promptTemplate,\n    marker,\n    dry_run: parsed.dry_run,\n    log_level: parsed.log_level,\n    skip_if_scrolling: parsed.skip_if_scrolling === false ? false : true,\n  };\n}","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/tmux-hook.ts#L138-L174","documentation":"The config's log_level must be exactly one of the strings \"error\", \"info\", or \"debug\". Any other value (including uppercase variants, \"warn\", \"warning\", or missing) is rejected.","triggerScenarios":"\"log_level\": \"warn\", \"INFO\", \"trace\", a number, or the key omitted (undefined).","commonSituations":"Habitual use of warn/trace levels from other logging libraries; case mismatches; templated configs injecting unsupported levels.","solutions":["Use exactly \"error\", \"info\", or \"debug\"","Pick \"error\" for quiet operation or \"debug\" for diagnostics","Regenerate config with omx tmux-hook init"],"exampleFix":"// before\n{\"log_level\": \"warn\"}\n// after\n{\"log_level\": \"info\"}","handlingStrategy":"validation","validationCode":"const levels = new Set(['error','info','debug']);\nif (!levels.has(cfg.log_level)) throw new Error('bad log_level');","typeGuard":"const isLogLevel = (v: unknown): v is 'error'|'info'|'debug' => v === 'error' || v === 'info' || v === 'debug';","tryCatchPattern":"try { await loadConfig(); } catch (e) { if (e instanceof Error && e.message.includes('log_level')) fixLevel(); }","preventionTips":["Only error/info/debug are allowed; no warn or trace","Exact lowercase match required"],"tags":["config","validation","enum","logging","tmux-hook"],"backgroundTag":"config-schema-validation-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}