"enum": [
"manager",
"supervisord",
+ "policy-loader",
+ "kresd",
"cache-gc",
"system",
"cache",
LogLevelEnum = Literal["crit", "err", "warning", "notice", "info", "debug"]
LogTargetEnum = Literal["syslog", "stderr", "stdout"]
-LogGroupsEnum = Literal[
+
+LogGroupsProcessesEnum = Literal[
"manager",
"supervisord",
+ "policy-loader",
+ "kresd",
"cache-gc",
+]
+
+LogGroupsKresdEnum = Literal[
## Now the LOG_GRP_*_TAG defines, exactly from ../../../lib/log.h
"system",
"cache",
# "reqdbg",... (non-displayed section of the enum)
]
+LogGroupsEnum = Literal[LogGroupsProcessesEnum, LogGroupsKresdEnum]
+
class DnstapSchema(ConfigSchema):
"""
{% from 'macros/common_macros.lua.j2' import boolean %}
-- logging.level
+{% if cfg.logging.groups and "kresd" in cfg.logging.groups %}
+log_level('debug')
+{% else %}
log_level('{{ cfg.logging.level }}')
+{% endif %}
{% if cfg.logging.target -%}
-- logging.target
-- logging.groups
log_groups({
{% for g in cfg.logging.groups %}
-{% if g != "manager" and g != "supervisord" and g != "cache-gc" %}
+{% if g not in ["manager", "supervisord", "policy-loader", "kresd", "cache-gc"] %}
'{{ g }}',
{% endif %}
{% endfor %}
local C = ffi.C
-- logging.level
+{% if cfg.logging.groups and "policy-loader" in cfg.logging.groups %}
+log_level('debug')
+{% else %}
log_level('{{ cfg.logging.level }}')
+{% endif %}
{% if cfg.logging.target -%}
-- logging.target
-- logging.groups
log_groups({
{% for g in cfg.logging.groups %}
-{% if g != "manager" and g != "supervisord" and g != "cache-gc" %}
+{% if g not in ["manager", "supervisord", "policy-loader", "kresd", "cache-gc"] %}
'{{ g }}',
{% endif %}
{% endfor %}
return {"type": "string"}
if is_literal(typ):
- lit = get_generic_type_arguments(typ)
+ lit: List[Any] = []
+ args = get_generic_type_arguments(typ)
+ for arg in args:
+ if is_literal(arg):
+ lit += get_generic_type_arguments(arg)
+ else:
+ lit.append(arg)
return {"type": "string", "enum": lit}
if is_optional(typ):