Skip to content

Conversation

@tonyfettes
Copy link
Contributor

This pull request refactors the daemon and server codebases to use a centralized logging mechanism (logger) instead of direct println statements for all informational, warning, and error messages. This improves consistency, log formatting, and future extensibility for logging output. The change touches all major daemon and server modules, introduces a logger instance, and updates package dependencies as needed.

Logging Infrastructure

  • Introduced a new logger instance using @pino.Logger in both cmd/daemon/logger.mbt and cmd/server/logger.mbt, replacing all direct println calls with structured logging methods like logger.info, logger.warn, and logger.error. [1] [2]

Daemon Code Refactoring

  • Replaced all println statements in daemon modules (daemon.mbt, daemon_create_task.mbt, daemon_get_task_events.mbt, daemon_listen_for_status_change.mbt, daemon_load_stopped.mbt, daemon_register_task.mbt, daemon_serve.mbt, daemon_spawn_task.mbt, http.mbt, lock_daemon_file.mbt, main.mbt, task_running_sync.mbt) with calls to the new logger instance, ensuring all logs are consistently formatted and categorized. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]

Server Code Refactoring

  • Updated all logging in server modules (server.mbt, server_register.mbt) to use the new logger instance, including structured logging with additional data fields for context where appropriate. [1] [2] [3] [4]

Dependency Updates

  • Added moonbitlang/maria/internal/pino to both daemon and server moon.pkg.json files to support the new logging infrastructure. [1] [2]

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors the logging infrastructure across the daemon, server, model, and OAuth codex modules to use a centralized @pino.Logger instead of direct println statements. This improves log consistency, structure, and maintainability.

Changes:

  • Introduced @pino.Logger instances in all major modules with descriptive tags ("Daemon", "Server", "Model", "Codex", "TestToBeKilled")
  • Replaced all println statements in refactored modules with appropriate structured logging calls (logger.info, logger.warn, logger.error)
  • Added moonbitlang/maria/internal/pino dependency to all affected packages

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cmd/daemon/logger.mbt Introduces Daemon logger instance
cmd/server/logger.mbt Introduces Server logger instance
oauth/codex/logger.mbt Introduces Codex logger instance
model/logger.mbt Introduces Model logger instance
cmd/test-to-be-killed/main.mbt Adds logger instance and updates logging calls
cmd/daemon/*.mbt Replaces println with structured logger calls across all daemon modules
cmd/server/server.mbt Updates server logging with structured data for context
cmd/server/server_register.mbt Adds structured data fields for registration logging
model/loader.mbt Updates model loading logging and changes load_openrouter_model to async
oauth/codex/credentials.mbt Updates credentials import logging
*/moon.pkg.json Adds pino dependency to all affected packages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tonyfettes tonyfettes force-pushed the haoxiang/refactor-use-pino-for-logging branch 2 times, most recently from 3c587bb to 8d8d23b Compare January 23, 2026 08:36
@tonyfettes tonyfettes force-pushed the haoxiang/refactor-use-pino-for-logging branch from 8d8d23b to 704f8cd Compare January 23, 2026 12:25
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.

2 participants