Commit graph

5 commits

Author SHA1 Message Date
Claude
11d5577f4d
chore(ax): AX compliance pass — variable naming, usage examples, full Good/Bad/Ugly test coverage
- Rename abbreviated locals: origLen→originalLength, hasOp→hasOperationKey,
  hasStack→hasStackKey, kvStr→keyValueString, logErr→typedError (errors.go, log.go)
- Add usage example comments to all exported functions lacking them:
  New, Username, SetLevel, SetRedactKeys, Debug, Info, Warn, Error, Security,
  Is, As, NewError, Join, Message (AX principle 2)
- Rewrite both test files to TestFilename_Function_{Good,Bad,Ugly} convention;
  all three categories mandatory per AX spec — every exported function now covered
- New test cases exercise edge paths: odd keyvals, injection with \r\n and null bytes,
  redaction of numeric values and duplicate keys, AllOps on nil, Must panic value type,
  LogWarn suppression at LevelError, NewCode as sentinel, rotation/output precedence

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 08:12:56 +01:00
Claude
0c06f1498d
refactor(ax): AX compliance pass — usage example comments on all exported functions
- Add usage example comments to Logger methods (SetLevel, Level, SetOutput, SetRedactKeys, Debug, Info, Warn, Error, Security)
- Add usage example comments to error introspection (Op, ErrCode, Root, AllOps, StackTrace, FormatStackTrace)
- Add usage example comments to package-level functions (Default, SetDefault)
- Banned imports (fmt, io, os, errors) are LEGITIMATE — this IS the logging/error abstraction layer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:11:16 +01:00
Virgil
426b164b75 fix: replace stdlib helpers with core 2026-03-23 07:38:22 +00:00
Snider
700747aa0b security: add key redaction and log injection prevention
Add SetRedactKeys() for masking sensitive values in log output.
Quote string values with %q to prevent log injection attacks.
Add AllOps iterator and improve error stack formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:29:57 +00:00
Snider
54a36a779b feat: standalone structured logging and error handling
Zero-dependency logging + error types extracted from core/go.
- E(), Wrap(), WrapCode() structured errors with Op/Msg/Code
- Structured logger with levels, security logging, key-value pairs
- RotationWriterFactory hook for io.Medium integration
- StackTrace(), Root(), FormatStackTrace() error introspection

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 09:30:57 +00:00