Skip to content

comment listing loglevels is unclear; probably "2 = WARNING" incorrect #8

Description

@Joerg-rw

https://github.com/OpenCCU/OpenCCU-Base/blame/5e9d5a4f59aeea8f951dacd1ba29edc60fc314b6/src/rfd/rfd.conf#L14
sorry fuer den "AI-slop" unten.
LEvel 2 und LEvel 5 sind als "WARNING" kommentiert.
Es ist unklar wie die Abstufung der loglevel tatsaechlicht ist, die Kommentarzeile sollte jemand der die Details kennt mal klarstellen.

(ab hier AI code Analyse, falls es jemand interessiert)
Direct answer — it's a comment that documents how the rfd daemon's numeric "log level" setting maps to human-readable severity names.

What the line means

  • The config uses a small integer to pick how noisy the logs are.
  • According to the comment the mapping is:
    • 1 = DEBUG (very verbose, for developers)
    • 2 = WARNING
    • 3 = INFO (general informational messages)
    • 4 = NOTICE (between INFO and WARNING)
    • 5 = WARNING (again)
    • 6 = ERROR (only error conditions)
  • Lower numbers (e.g. 1) are more verbose; higher numbers (e.g. 6) are more restrictive and log only more severe events.

Notes / observations

  • The comment contains a duplicate mapping of WARNING (for both 2 and 5). That may be a typo, a deliberate choice by the program author, or an artifact of how the program groups severities. If you rely on this mapping it’s worth confirming by checking the code that reads rfd.conf or by testing different numeric values.
  • The numeric ordering and names here do not match the standard syslog numeric codes (syslog uses 0..7 with different names). Treat this as a program-specific convention.

[...]

The Logger type and numeric mapping actually used at runtime

The Logger enum is defined in src/libelvutils/Logger.h:

typedef enum { LOG_ALL, LOG_DEBUG, LOG_INFO, LOG_NOTICE, LOG_WARNING, LOG_ERROR, LOG_FATAL_ERROR } LogLevel;

This means numeric values correspond to:
    0 = LOG_ALL
    1 = LOG_DEBUG
    2 = LOG_INFO
    3 = LOG_NOTICE
    4 = LOG_WARNING
    5 = LOG_ERROR
    6 = LOG_FATAL_ERROR

See: https://github.com/OpenCCU/OpenCCU-Base/blob/main/src/libelvutils/Logger.h

The rfd.conf comment you pointed at (line shown) is inconsistent with this enum. The comment reads: "# Log Level: 1=DEBUG, 2=WARNING, 3=INFO, 4=NOTICE, 5=WARNING, 6=ERROR"
    That mapping is incorrect relative to the code: the code casts the integer directly to the enum, so the actual runtime mapping is the enum order above (1=DEBUG, 2=INFO, 3=NOTICE, 4=WARNING, 5=ERROR, 6=FATAL_ERROR). Also note CONFIG_DEFAULTS in rfd.cpp sets the default "Log Level" to "3" — that corresponds to LOG_NOTICE in the enum, even though the rfd.conf comment says "Default is Info". So there are two mismatches in the comment: the ordering and the stated default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions