{"action":"opened","issue":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/9761","repository_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr","labels_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/9761/labels{/name}","comments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/9761/comments","events_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/9761/events","html_url":"https://github.com/zephyrproject-rtos/zephyr/issues/9761","id":356393099,"node_id":"MDU6SXNzdWUzNTYzOTMwOTk=","number":9761,"title":"Add kconfig templates to avoid code repetition","user":{"login":"nordic-krch","id":16899589,"node_id":"MDQ6VXNlcjE2ODk5NTg5","avatar_url":"https://avatars3.githubusercontent.com/u/16899589?v=4","gravatar_id":"","url":"https://api.github.com/users/nordic-krch","html_url":"https://github.com/nordic-krch","followers_url":"https://api.github.com/users/nordic-krch/followers","following_url":"https://api.github.com/users/nordic-krch/following{/other_user}","gists_url":"https://api.github.com/users/nordic-krch/gists{/gist_id}","starred_url":"https://api.github.com/users/nordic-krch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nordic-krch/subscriptions","organizations_url":"https://api.github.com/users/nordic-krch/orgs","repos_url":"https://api.github.com/users/nordic-krch/repos","events_url":"https://api.github.com/users/nordic-krch/events{/privacy}","received_events_url":"https://api.github.com/users/nordic-krch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-03T07:47:28Z","updated_at":"2018-09-03T07:47:28Z","closed_at":null,"author_association":"COLLABORATOR","body":"Many modules (ideally all) has own, unique logging level configuration in kconfig. From user perspective this configuration should look the same for each module (choice vs raw int, configuration message, help, etc.). Ideally there should be some way of defining template or macro. It could be generic or log specific if we don't see other use case.\r\n\r\nIt could be something like:\r\n\r\n```\r\nmacro LOG_CONFIG(MODULE, module_str)\r\nchoice\r\nprompt \"<module_str> logging level\"\r\n\r\nconfig <MODULE>_LOG_LEVEL_OFF\r\nbool \"Off\"\r\nconfig <MODULE>_LOG_LEVEL_ERR\r\nbool \"Error\"\r\nconfig <MODULE>_LOG_LEVEL_WRN\r\nbool \"Warning\"\r\nconfig <MODULE>_LOG_LEVEL_INF\r\nbool \"Info\"\r\nconfig <MODULE>_LOG_LEVEL_DBG\r\nbool \"Debug\"\r\nendchoice\r\n\r\nconfig <MODULE>_LOG_LEVEL\r\nint\r\ndefault 0 if <MODULE>_LOG_LEVEL_OFF\r\ndefault 1 if <MODULE>_LOG_LEVEL_ERR\r\ndefault 2 if <MODULE>_LOG_LEVEL_WRN\r\ndefault 3 if <MODULE>_LOG_LEVEL_INF\r\ndefault 4 if <MODULE>_LOG_LEVEL_DBG\r\n\r\nendmacro\r\n```\r\nUsage:\r\n\r\n`LOG_CONFIG(BLUETOOTH_LL, Bluetooth link layer)`\r\n\r\nInitially it was proposed in the following review:\r\nhttps://github.com/zephyrproject-rtos/zephyr/pull/8816#discussion_r208098277\r\n\r\n"}}
{"actor":{"display_login":"nordic-krch"}}