Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Platform] [Python] C++ and Python use inconsistent values (PriorityLevel) #25997

Closed
yzm157 opened this issue Apr 6, 2023 · 1 comment · Fixed by #26872
Closed

[Platform] [Python] C++ and Python use inconsistent values (PriorityLevel) #25997

yzm157 opened this issue Apr 6, 2023 · 1 comment · Fixed by #26872
Labels

Comments

@yzm157
Copy link
Contributor

yzm157 commented Apr 6, 2023

Reproduction steps

C++ defined PriorityLevel at src/app/EventLoggingTypes.h

enum class PriorityLevel : uint8_t
{

    First = 0,
    /**
     *  Debug priority denotes log entries of interest to the
     *  developers of the system and is used primarily in the
     *  development phase. Debug priority logs are
     *  not accounted for in the bandwidth or power budgets of the
     *  constrained devices; as a result, they must be used only over
     *  a limited time span in production systems.
     */

    Debug = First,
    /**
     * Info priority denotes log entries that provide extra insight
     * and diagnostics into the running system. Info logging level may
     * be used over an extended period of time in a production system,
     * or may be used as the default log level in a field trial. On
     * the constrained devices, the entries logged with Info level must
     * be accounted for in the bandwidth and memory budget, but not in
     * the power budget.
     */
    Info = 1,

    /**
     * Critical priority denotes events whose loss would
     * directly impact customer-facing features. Applications may use
     * loss of Production Critical events to indicate system failure.
     * On constrained devices, entries logged with Critical
     * priority must be accounted for in the power and memory budget,
     * as it is expected that they are always logged and offloaded
     * from the device.
     */
    Critical = 2,
    Last     = Critical,
    Invalid  = Last + 1,

};

Python defined PriorityLevel at src/controller/python/chip/clusters/Attribute.py

@unique
class EventPriority(Enum):
    DEBUG = 1
    INFO = 2
    CRITICAL = 3

Platform

python

Platform Version(s)

No response

Type

Unit tested

(Optional) If manually tested please explain why this is only manually tested

No response

Anything else?

No response

@yzm157 yzm157 changed the title [Platform] C++ and Python use inconsistent values (PriorityLevel) [Platform][python] C++ and Python use inconsistent values (PriorityLevel) Apr 6, 2023
@yzm157 yzm157 changed the title [Platform][python] C++ and Python use inconsistent values (PriorityLevel) [Platform] [Python] C++ and Python use inconsistent values (PriorityLevel) Apr 6, 2023
@bzbarsky-apple
Copy link
Contributor

In the spec, "7.18.2.25. Priority" says the values are DEBUG = 0, INFO = 1, CRITICAL = 2. So the C++ is right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants