Skip to content

Prevent log loss in idle/shared pre-tracing paths by using info_or_print!-style macros #338

Description

@kimhanbeom

Summary

Some idle-mode and idle-shared code paths can run before the tracing dispatcher is initialized.
In those paths, direct info!, warn!, and error! calls may not be visible, which hurts operational observability.
Please switch those logs to info_or_print!, warn_or_print!, and error_or_eprint! so logs remain visible regardless of tracing initialization state.

Background

init_tracing() is executed inside run() after configuration loading. Therefore, at the point when the process enters idle mode, tracing may not have been initialized yet.

The following events can occur during idle mode and therefore require pre-tracing log visibility:

  • TLS reload (SIGHUP) and Shutdown (SIGINT/SIGTERM): include all related code paths from signal registration/reception to main-loop handling and idle-mode transition/exit behavior.

Scope

  • src/logging.rs
    • If needed, add a warn_or_print! macro with the same fallback behavior as info_or_print! and error_or_eprint!.
  • Replace direct info!/warn!/error! in idle-only or idle-shared paths that may run pre-tracing

Acceptance Criteria

  • In pre-tracing state, logs from the targeted idle/shared paths are still printed to stdout/stderr.
  • With tracing initialized, logs continue to go through tracing as before.
  • TLS reload and shutdown control flow remains unchanged.
  • No behavioral regression; build/tests pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions