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

Generate mod log names #551

Merged
merged 1 commit into from Apr 13, 2024
Merged

Generate mod log names #551

merged 1 commit into from Apr 13, 2024

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented Apr 3, 2024

This adds "name:" to syscfg.logs nodes.
This is optional log name.

With this change newt tool also generates file:
<bsp>-logcfg.c that contains function:
const char *logcfg_log_module_name(uint8_t id)

that can be used to get module name for generated mod logs.

If name is not present like in this example:

syscfg.logs:
    BMA400_LOG:
        module: MYNEWT_VAL(BMA400_LOG_MODULE)
        level: MYNEWT_VAL(BMA400_LOG_LVL)

module name will be taken from BMA400_LOG by cutting off trailing _LOG to make it BMA400

Copy link

@rymanluk rymanluk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sjanc
Copy link
Contributor

sjanc commented Apr 12, 2024

@m-gorecki please have a look

This adds "name:" to syscfg.logs nodes.
This is optional log name.

With this change newt tool also generates file:
<bsp>-logcfg.c that contains function:
const char *logcfg_log_module_name(uint8_t id)

that can be used to get module name for generated mod logs.

If name is not present like in this example:
syscfg.logs:
    BMA400_LOG:
        module: MYNEWT_VAL(BMA400_LOG_MODULE)
        level: MYNEWT_VAL(BMA400_LOG_LVL)

module name will be taken from BMA400_LOG by cutting off
trailing _LOG to make it BMA400
@kasjer kasjer merged commit cb6f87f into apache:master Apr 13, 2024
59 checks passed
@kasjer kasjer deleted the kasjer/logcfg branch April 13, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants