refactor: use @pino for logging #928
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors the daemon and server codebases to use a centralized logging mechanism (
logger) instead of directprintlnstatements 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
loggerinstance using@pino.Loggerin bothcmd/daemon/logger.mbtandcmd/server/logger.mbt, replacing all directprintlncalls with structured logging methods likelogger.info,logger.warn, andlogger.error. [1] [2]Daemon Code Refactoring
printlnstatements 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 newloggerinstance, 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
server.mbt,server_register.mbt) to use the newloggerinstance, including structured logging with additional data fields for context where appropriate. [1] [2] [3] [4]Dependency Updates
moonbitlang/maria/internal/pinoto both daemon and servermoon.pkg.jsonfiles to support the new logging infrastructure. [1] [2]