Orkid Logging System Reference
When answering questions about logging in orkid, consult these files.
Key Files
| Component | Location |
|-----------|----------|
| Logger Header | ork.core/inc/ork/util/logger.h |
| Logger Impl | ork.core/src/util/logger.cpp |
| Stdout Backend | ork.core/src/util/logger_std.cpp |
| File Backend | ork.core/src/util/logger_file.cpp |
| HTML Backend | ork.core/src/util/logger_html.cpp |
| HTTP Backend | ork.core/src/util/logger_http.cpp |
| Python Bindings | ork.core/pyext/pyext_logger.cpp |
Usage
from orkengine import core
# Get logger singleton
logger = core.Logger.instance()
# Get or create channel
chan = logger.getChannel("MYAPP")
chan = logger.configureChannel("MYAPP", core.fvec3(0.5, 0.8, 1.0), True)
# Log messages
chan.log("message")
chan.warn("warning") # Goes to stderr (red)
chan.error("error") # Goes to stderr (red)
chan.status("sub", "msg") # Status with subchannel label
# Multi-part messages
chan.log_begin("start")
chan.log_continue("middle")
chan.log_end()
# Enable/disable
chan.enabled = True
C++ Pattern
// Typical: module-level channel
static logchannel_ptr_t logchan_mymod = logger()->getChannel("MYMOD");
logchan_mymod->log("Processing %d items", count);
logchan_mymod->warn("Unexpected state");
Performance Metrics
# Push immediate value
chan.perfItem("fps", 60.0)
# Pull value via lambda (sampled at perf_interval)
chan.perfItem("frame_time", lambda: get_frame_time())
# Configure sampling rate
chan.perf_interval = 0.001 # 1000 Hz sampling
chan.status_interval = 8.0 # Status dedup interval
Backends
| Backend | Env Config | Purpose |
|---------|-----------|---------|
| Stdout | ORKID_LOGGER_BACKEND=STDOUT | Console (default) |
| File | ORKID_LOGGER_BACKEND=FILE | Async file write |
| HTML | ORKID_LOGGER_BACKEND=HTML | Interactive HTML log |
| HTTP | ORKID_LOGGER_BACKEND=HTTP | Live streaming via ZMQ+SSE |
| Fork | ORKID_LOGGER_BACKEND=[STDOUT,FILE] | Multiple backends |
File options: ORKID_LOGGER_FILE_ANSI=1, ORKID_LOGGER_FILE_FLUSH_MS=100
Channel Filtering (Environment)
ORKID_LOGCHAN_0=1 # Enable all ('0' = wildcard)
ORKID_LOGCHAN_CATALOG=1 # Enable CATALOG channel
ORKID_LOGCHAN_GPU0=0 # Disable GPU* channels
ORKID_LOG_DISABLE=1 # Disable all logging
How to Answer
- For API: read
logger.hfor channel methods - For backends: check
logger_*.cppimplementations - No log levels — use
log()vswarn()vserror()for severity - Channels use plain
std::stringnames, not CrcStrings