logsetup
laser.cholera.metapop.logsetup
¶
Process-wide logging setup for the laser.cholera package.
Installs a lazy file handler (the file is only opened on first write,
so a run that never logs leaves no trash log behind) on the
laser.cholera logger. Idempotent: subsequent calls are no-ops, so it
is safe to import multiple times and to be re-invoked from cli_run.
Imported and called once at import time with a WARNING level so the
log file path is established before any other component imports
logger.
setup_logging
¶
Configure the laser.cholera logger with a lazy timestamped file handler.
The handler is LazyFileHandler (subclasses logging.FileHandler
with delay=True and opens the file only on first emit) — runs
that never log do not leave an empty log file. Idempotent: after
the first call the global _log_file_handler is set, and further
calls return immediately without re-configuring the logger.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loglevel
|
str | int
|
Logging level to apply to the |
required |
outdir
|
Path
|
Directory the log file is created in. The filename is
derived from the current wall-clock time
( |
required |