Log Levels
Understanding the log level hierarchy.
Level Hierarchy
Vestig uses 5 log levels, ordered from most to least verbose:
| Level | Value | Use Case |
|---|---|---|
trace | 10 | Very detailed debugging, performance tracing |
debug | 20 | Development debugging, variable inspection |
info | 30 | General information, user actions, events |
warn | 40 | Warnings, deprecations, potential issues |
error | 50 | Errors, exceptions, failures |
Setting the Level
Via Configuration
typescript
Via Environment Variable
bash
At Runtime
typescript
Level Filtering
Logs below the configured level are ignored:
typescript
Level Methods
Each level has a corresponding method:
typescript
Recommended Usage
trace — Granular Debugging
Use for very detailed information that's usually too verbose:
typescript
debug — Development Info
Use for information helpful during development:
typescript
info — Business Events
Use for important application events:
typescript
warn — Potential Issues
Use for things that might cause problems:
typescript
error — Failures
Use for actual errors and exceptions:
typescript
Environment-Based Levels
Common pattern for different environments:
typescript
Or use environment variables:
bash
Level Constants
Access level values programmatically:
typescript