1# Copyright (c) 2016 Intel Corporation
2# SPDX-License-Identifier: Apache-2.0
3
4menu "Logging"
5
6config LOG
7	bool "Logging"
8	select PRINTK if USERSPACE
9	help
10	  Global switch for the logger, when turned off log calls will not be
11	  compiled in.
12
13if LOG
14
15config LOG_CORE_INIT_PRIORITY
16	int "Log Core Initialization Priority"
17	range 0 99
18	default 0
19
20rsource "Kconfig.mode"
21
22rsource "Kconfig.filtering"
23
24rsource "Kconfig.processing"
25
26if !LOG_MODE_MINIMAL
27
28rsource "Kconfig.formatting"
29
30if !LOG_FRONTEND_ONLY
31
32rsource "backends/Kconfig"
33
34endif # !LOG_FRONTEND_ONLY
35
36endif # !LOG_MODE_MINIMAL
37
38if LOG_FRONTEND
39
40rsource "frontends/Kconfig"
41
42endif #LOG_FRONTEND
43
44if LOG_MULTIDOMAIN
45
46rsource "Kconfig.links"
47
48endif
49
50rsource "Kconfig.misc"
51
52config LOG_RATELIMIT
53	bool "Rate-limited logging macros"
54	default y
55	help
56	  When enabled, provides rate-limited logging macros that prevent
57	  log flooding when messages are generated frequently. Rate limiting
58	  is per-macro-call-site, meaning each unique call has its own
59	  independent rate limit.
60
61if LOG_RATELIMIT
62
63config LOG_RATELIMIT_INTERVAL_MS
64	int "Default rate limit interval (milliseconds)"
65	default 5000
66	range 100 60000
67	help
68	  Default interval between rate-limited log messages.
69	  This is used by the convenience macros LOG_*_RATELIMIT
70	  when no explicit rate is provided. Can be overridden per call
71	  using LOG_*_RATELIMIT_RATE macros.
72
73endif # LOG_RATELIMIT
74
75if !LOG_RATELIMIT
76
77choice LOG_RATELIMIT_FALLBACK
78	prompt "Fallback behavior for rate-limited logging macros"
79	default LOG_RATELIMIT_FALLBACK_DROP
80	help
81	  Select fallback behavior for rate-limited logging macros when
82	  LOG_RATELIMIT is disabled.
83
84	  - "Log all prints": All log prints are output, i.e., rate limiting is ignored.
85	  - "Drop all prints": All log prints using rate-limited macros are dropped.
86
87	  This option allows you to control whether rate-limited log macros
88	  should always print or be completely suppressed when rate limiting
89	  is not available.
90
91config LOG_RATELIMIT_FALLBACK_LOG
92	bool "Log all prints (ignore rate limiting)"
93	help
94	  All log prints using rate-limited macros are output as normal logs.
95
96config LOG_RATELIMIT_FALLBACK_DROP
97	bool "Drop all prints"
98	help
99	  All log prints using rate-limited macros are dropped (no output).
100
101endchoice
102
103endif # !LOG_RATELIMIT
104
105endif # LOG
106
107config LOG_OUTPUT
108	bool "Formatter helper"
109	help
110	  Module which provides formatting of log messages to a human-readable
111	  strings.
112
113endmenu
114