magical markdown slides
1# Logging
2
3Lantern uses the `tracing` framework for internal logging and diagnostics. By default, logging is disabled, but can be enabled via environment variables for debugging and troubleshooting.
4
5## Configuration
6
7### File Path
8
9To enable logging to a file, set the `LANTERN_LOG_FILE` environment variable:
10
11```bash
12export LANTERN_LOG_FILE=/path/to/lantern.log
13lantern present slides.md
14```
15
16If `LANTERN_LOG_FILE` is not set, logs are discarded and won't appear anywhere.
17
18### Level
19
20Control the verbosity of logs using the `--log-level` flag:
21
22```bash
23LANTERN_LOG_FILE=debug.log lantern --log-level debug present slides.md
24```
25
26## Usage Examples
27
28### Basic Debugging
29
30Enable info-level logging for general troubleshooting:
31
32```bash
33LANTERN_LOG_FILE=lantern.log lantern present slides.md
34```
35
36### Detailed Diagnostics
37
38Enable trace-level logging for in-depth debugging:
39
40```bash
41LANTERN_LOG_FILE=lantern-trace.log lantern --log-level trace present slides.md
42```
43
44### Temporary Log File
45
46Use a temporary file that gets cleaned up automatically:
47
48```bash
49LANTERN_LOG_FILE=/tmp/lantern-$$.log lantern present slides.md
50```
51
52## Log Format
53
54Logs are written in plain text format without ANSI color codes, making them easy to read and process with standard tools:
55
56```sh
572025-11-18T10:30:45.123Z INFO lantern_cli: Presenting slides from: slides.md
582025-11-18T10:30:45.234Z INFO lantern_cli: Theme selection: CLI arg=None, frontmatter=oxocarbon-dark, final=oxocarbon-dark
592025-11-18T10:30:45.345Z DEBUG lantern_core::parser: Parsed 15 slides from markdown
60```