Skip to content

Core Concepts

Eduard Mishkurov edited this page May 3, 2026 · 3 revisions

Core Concepts

logme is built around a small number of concepts that work together.
Understanding how they relate to each other is more important than memorizing individual features.


General idea

When a log message is written, logme does three things:

  • decides whether the message should be logged
  • prepares the message (formatting, metadata)
  • sends it to one or more outputs

These responsibilities are split between different parts of the system.


Channel

A channel is the main logging entity.

You can think of it as a named source of messages — for example HTTP, TLS or DB.
Channels control whether messages are emitted and at what level.

When a logging macro is called, the first decision is made at the channel level: should this message be processed at all.


Subsystem (SID)

A subsystem is an additional tag attached to a message.

It does not exist on its own and cannot be enabled or disabled directly.
Instead, it is used to refine filtering inside a channel.

In practice, channels answer “which part of the system”,
while subsystems answer “which aspect inside that part”.


Backend

A backend defines where messages are written.

Typical examples are console output, files or debugger output.
A single message can be sent to multiple backends at the same time.

Backends do not decide whether a message should exist —
they only handle delivering it somewhere.


Context

When a message passes the channel check, logme creates an internal representation of it.

This representation is called a context.

The context contains:

  • the message text (or formatting data)
  • metadata such as level and time
  • structured fields if they are used

The context is then passed through formatting and finally to backends.


Message flow

Putting it all together:

  1. application calls a logging macro
  2. channel decides whether the message is enabled
  3. context is created
  4. message is formatted
  5. message is sent to backends

Why it is structured this way

This separation allows logme to:

  • avoid unnecessary work when logging is disabled
  • change behavior at runtime (channels, backends, levels)
  • support multiple output formats without changing application code

Summary

Channels control what is logged.
Backends control where it goes.
Subsystems refine filtering.
Context carries the message through the system.

Clone this wiki locally