Skip to content

feat: add ILogger interface, LogLevel, and ILoggerOptions#12

Closed
TonyCasey wants to merge 1 commit intomainfrom
tony/git-33-domain-layer-ilogger-interface-loglevel-iloggeroptions
Closed

feat: add ILogger interface, LogLevel, and ILoggerOptions#12
TonyCasey wants to merge 1 commit intomainfrom
tony/git-33-domain-layer-ilogger-interface-loglevel-iloggeroptions

Conversation

@TonyCasey
Copy link
Copy Markdown
Owner

@TonyCasey TonyCasey commented Feb 6, 2026

Summary

  • Added src/domain/interfaces/ILogger.ts with domain-layer logging contracts
  • LogLevel type: trace, debug, info, warn, error, fatal
  • ILoggerOptions interface: level, logDir, enableConsole, enableFile, retentionDays
  • ILogger interface: level methods, child logger support, isLevelEnabled()

Fixes GIT-33

Test plan

  • npm run build compiles cleanly
  • npm test — all 135 tests pass
  • Interface has zero dependencies (domain layer)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Established logging infrastructure foundation supporting trace, debug, info, warn, error, and fatal level logging with configurable console and file outputs, data retention policies, and hierarchical logger creation.

Domain-layer logging contracts with zero dependencies. Provides log
levels (trace through fatal), child logger support, and configuration
options for file/console output.

GIT-33

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

This PR introduces a new domain interface file (ILogger.ts) that defines the logging contract. It includes a LogLevel type representing standard log levels, an ILoggerOptions interface for configuration options, and an ILogger interface with per-level logging methods, child logger creation, and level checking capabilities. No implementations are provided.

Changes

Cohort / File(s) Summary
Logger Domain Interface
src/domain/interfaces/ILogger.ts
New file introducing LogLevel type, ILoggerOptions interface for logger configuration (level, directory, console/file outputs, retention), and ILogger interface with trace/debug/info/warn/error/fatal methods, child() for creating child loggers, and isLevelEnabled() for checking if a level is enabled.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: introducing the ILogger interface, LogLevel type, and ILoggerOptions interface to the domain layer.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tony/git-33-domain-layer-ilogger-interface-loglevel-iloggeroptions

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/domain/interfaces/ILogger.ts`:
- Around line 10-16: Change the ILoggerOptions interface so consumers don’t need
to pass every setting: make the properties optional (e.g., level?: LogLevel;
logDir?: string; enableConsole?: boolean; enableFile?: boolean; retentionDays?:
number) and ensure callers/implementations (e.g., where createLogger or any
Logger implementation consumes ILoggerOptions) merge with sensible defaults
(like level='info', logDir='.git-mem/logs', enableConsole=false,
enableFile=true, retentionDays=7) using an object spread or similar so missing
fields are filled in at runtime.

Comment on lines +10 to +16
export interface ILoggerOptions {
level: LogLevel;
logDir: string; // Default: '.git-mem/logs'
enableConsole: boolean; // Default: false
enableFile: boolean; // Default: true
retentionDays: number; // Default: 7
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider making properties optional for ergonomic configuration.

All properties are currently required, meaning implementers/consumers must always specify every option. Consider whether some properties (those with sensible defaults noted in comments) should be optional:

export interface ILoggerOptions {
  level?: LogLevel;          // Default: 'info' (common convention)
  logDir?: string;           // Default: '.git-mem/logs'
  enableConsole?: boolean;   // Default: false
  enableFile?: boolean;      // Default: true
  retentionDays?: number;    // Default: 7
}

This allows simpler instantiation: createLogger({}) vs requiring all fields. The infrastructure implementation can apply defaults via { ...defaults, ...options }.

🤖 Prompt for AI Agents
In `@src/domain/interfaces/ILogger.ts` around lines 10 - 16, Change the
ILoggerOptions interface so consumers don’t need to pass every setting: make the
properties optional (e.g., level?: LogLevel; logDir?: string; enableConsole?:
boolean; enableFile?: boolean; retentionDays?: number) and ensure
callers/implementations (e.g., where createLogger or any Logger implementation
consumes ILoggerOptions) merge with sensible defaults (like level='info',
logDir='.git-mem/logs', enableConsole=false, enableFile=true, retentionDays=7)
using an object spread or similar so missing fields are filled in at runtime.

@TonyCasey
Copy link
Copy Markdown
Owner Author

Closing — this work (ILogger interface) was already delivered via PR #18 (branch git-33) which is merged to main.

@TonyCasey TonyCasey closed this Feb 11, 2026
@TonyCasey TonyCasey deleted the tony/git-33-domain-layer-ilogger-interface-loglevel-iloggeroptions branch February 11, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant