Expand description
§Sets up logging by reading configuration from environment variables.
Environment variables used:
- LOG_MODE: “stdout” (default) or “file”
- LOG_LEVEL: log level (“trace”, “debug”, “info”, “warn”, “error”); default is “info”
- LOG_DATA_DIR: when using file mode, the path of the log file (default “logs/relayer.log”)
Functions§
- Computes the path of the rolled log file given the base file path and the date string.
- Sets up logging by reading configuration from environment variables.
- Checks if the given log file exceeds the maximum allowed size (in bytes). If so, it appends a sequence number to generate a new file name. Returns the final log file path to use.
- Generates a time-based log file name. This is simply a wrapper around
compute_rolled_file_path
for clarity.