init_from_dir

Function init_from_dir 

Source
pub fn init_from_dir(preferred: &Path)
Expand description

Initialize tracing subscriber from a preferred directory or current working directory.

Search order:

  1. <preferred>/logging.yml
  2. ./logging.yml
  3. Defaults (info level, ANSI enabled, with timestamps)

§Arguments

  • preferred - Directory to search first (typically the config file’s parent directory)

§Behavior

  • Uses try_init() - silently ignores if a subscriber is already installed
  • Emits a debug-level diagnostic line (via the tracing subscriber) on success or when already initialized (may be filtered)
  • Never panics