Skip to content

refactor: deduplicate logger into shared module#39

Merged
gavrielc merged 1 commit intoqwibitai:mainfrom
Ejae-dev:refactor/shared-logger
Feb 3, 2026
Merged

refactor: deduplicate logger into shared module#39
gavrielc merged 1 commit intoqwibitai:mainfrom
Ejae-dev:refactor/shared-logger

Conversation

@Ejae-dev
Copy link
Copy Markdown
Contributor

@Ejae-dev Ejae-dev commented Feb 2, 2026

Type of Change

  • Skill - adds a new skill in .claude/skills/
  • Fix - bug fix or security fix to source code
  • Simplification - reduces or simplifies source code

Description

three files (index.ts, container-runner.ts, task-scheduler.ts) each created their own identical pino logger with the same config:

const logger = pino({
  level: process.env.LOG_LEVEL || 'info',
  transport: { target: 'pino-pretty', options: { colorize: true } }
});

this extracts it into a single src/logger.ts module and replaces the three copies with imports. net result: -9 lines, zero behavior change.

files changed:

file change
src/logger.ts new shared module
src/index.ts remove pino import + logger block, add logger import
src/container-runner.ts same
src/task-scheduler.ts same

typechecks clean (tsc --noEmit passes with zero errors).

@Ejae-dev Ejae-dev requested a review from gavrielc as a code owner February 2, 2026 19:18
chidev referenced this pull request in lev-os/nanoclaw Feb 3, 2026
Extract identical pino logger configuration from index.ts,
container-runner.ts, and task-scheduler.ts into a shared
src/logger.ts module. Net -9 lines, zero behavior change.

Upstream: gavrielc/nanoclaw#39
chidev referenced this pull request in lev-os/nanoclaw Feb 3, 2026
Extract identical pino logger configuration from index.ts,
container-runner.ts, and task-scheduler.ts into a shared
src/logger.ts module. Net -9 lines, zero behavior change.

Upstream: gavrielc/nanoclaw#39
@chidev
Copy link
Copy Markdown

chidev commented Feb 3, 2026

Reviewed and tested on our fork. LGTM ✅

Textbook DRY refactor — 3 identical pino configs consolidated into shared src/logger.ts. Net negative lines, zero behavior change. Clean compile, no regressions.

Recommend merging this before PR #24 (Linux Docker) since both touch container-runner.ts.

chidev referenced this pull request in lev-os/nanoclaw Feb 3, 2026
Extract identical pino logger configuration from index.ts,
container-runner.ts, and task-scheduler.ts into a shared
src/logger.ts module. Net -9 lines, zero behavior change.

Upstream: gavrielc/nanoclaw#39
@gavrielc gavrielc force-pushed the main branch 2 times, most recently from c83bc27 to 80e68dc Compare February 3, 2026 15:03
three files created identical pino logger instances with the same config.
extract into src/logger.ts and import from each consumer.

net -9 lines, no behavior change.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gavrielc gavrielc force-pushed the refactor/shared-logger branch from e9b3d3e to 4a1974e Compare February 3, 2026 22:40
@gavrielc gavrielc merged commit 1179801 into qwibitai:main Feb 3, 2026
@gavrielc
Copy link
Copy Markdown
Collaborator

gavrielc commented Feb 3, 2026

@Ejae-dev less code! Love it 😍 More of this please

BenSanex pushed a commit to BenSanex/nanoclaw that referenced this pull request Feb 4, 2026
three files created identical pino logger instances with the same config.
extract into src/logger.ts and import from each consumer.

net -9 lines, no behavior change.

Co-authored-by: ejae <ejae_dev@ejaes-Mac-mini.home>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
darkbringer1 pushed a commit to darkbringer1/nanoclaw that referenced this pull request Feb 7, 2026
three files created identical pino logger instances with the same config.
extract into src/logger.ts and import from each consumer.

net -9 lines, no behavior change.

Co-authored-by: ejae <ejae_dev@ejaes-Mac-mini.home>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
TerrifiedBug referenced this pull request in TerrifiedBug/nanotars Feb 9, 2026
three files created identical pino logger instances with the same config.
extract into src/logger.ts and import from each consumer.

net -9 lines, no behavior change.

Co-authored-by: ejae <ejae_dev@ejaes-Mac-mini.home>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
tunmaker pushed a commit to tunmaker/nanoclaw that referenced this pull request Feb 24, 2026
three files created identical pino logger instances with the same config.
extract into src/logger.ts and import from each consumer.

net -9 lines, no behavior change.

Co-authored-by: ejae <ejae_dev@ejaes-Mac-mini.home>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
bebekim pushed a commit to bebekim/goodclaw that referenced this pull request Mar 14, 2026
three files created identical pino logger instances with the same config.
extract into src/logger.ts and import from each consumer.

net -9 lines, no behavior change.

Co-authored-by: ejae <ejae_dev@ejaes-Mac-mini.home>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
squarewings pushed a commit to squarewings/nanoclaw that referenced this pull request Mar 15, 2026
three files created identical pino logger instances with the same config.
extract into src/logger.ts and import from each consumer.

net -9 lines, no behavior change.

Co-authored-by: ejae <ejae_dev@ejaes-Mac-mini.home>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
kenansun-dev-bot Bot pushed a commit to kenansun-dev/nanoclaw-github-copilot that referenced this pull request Apr 12, 2026
…bitai#39)

New format:
  chats: { telegram: [{ jid: 'tg:123', name: 'kenan', isMain: true }] }

Old format still supported (auto-detected on load).
Save always writes new format.
Internal runtime format unchanged (flat Record<jid, config>).

344/344 tests pass.

Co-authored-by: Kenan VM Claw <vm-claw@kenan.dev>
dm-j pushed a commit to dm-j/nanoclaw that referenced this pull request Apr 13, 2026
three files created identical pino logger instances with the same config.
extract into src/logger.ts and import from each consumer.

net -9 lines, no behavior change.

Co-authored-by: ejae <ejae_dev@ejaes-Mac-mini.home>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.

3 participants