blob: 4247532c894e76af1296b6e3bcf50e0d52f5f6a7 [file] [log] [blame]
Nicky Sielicki1f38d792015-06-06 07:51:54 -05001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2015 Nicholas Sielicki <sielicki@nicky.io>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Nicky Sielicki1f38d792015-06-06 07:51:54 -050015 */
16
Eric Biederman8ca8d762003-04-22 19:02:15 +000017#ifndef LOGLEVEL_H
18#define LOGLEVEL_H
19
Nicky Sielicki1f38d792015-06-06 07:51:54 -050020/**
21 * @file loglevel.h
22 *
23 * \brief Definitions of the log levels to be used in printk calls.
24 *
25 * Safe for inclusion in assembly.
26 *
27 */
28
29/**
30 * \brief BIOS_EMERG - Emergency / Fatal
31 *
32 * Log level for when the system is entirely unusable. To be used when execution
33 * is halting as a result of the failure. No further instructions should run.
34 *
35 * Example - End of all debug output / death notice.
36 *
37 * @{
38 */
39#define BIOS_EMERG 0
40/** @} */
41
42/**
43 * \brief BIOS_ALERT - Dying / Unrecoverable
44 *
45 * Log level for when the system is certainly in the process of dying.
46 * To be used when execution will eventually halt as a result of the
47 * failure, but the system can still output valuable debugging
48 * information.
49 *
50 * Example - Ram initialization fails, dumping relevant POST codes and
51 * information
52 *
53 * @{
54 */
55#define BIOS_ALERT 1
56/** @} */
57
58/**
59 * \brief BIOS_CRIT - Recovery unlikely
60 *
61 * Log level for when the system has experienced a dire issue in essential
62 * components. To be used when boot will probably be unsuccessful as a
63 * result of the failure, but recovery/retry can be attempted.
64 *
65 * Example - MSR failures, SMM/SMI failures.
66 * or
67 *
68 * @{
69 */
70#define BIOS_CRIT 2
71/** @} */
72
73/**
74 * \brief BIOS_ERR - System in incomplete state.
75 *
76 * Log level for when the system has experienced an issue that may not preclude
77 * a successful boot. To be used when coreboot execution may still succeed,
78 * but the error places some non-essential portion of the machine in a broken
79 * state that will be noticed downstream.
80 *
81 * Example - Payload could still load, but will be missing access to integral
82 * components such as drives.
83 *
84 * @{
85 */
86#define BIOS_ERR 3
87/** @} */
88
89/**
90 * \brief BIOS_WARNING - Bad configuration
91 *
92 * Log level for when the system has noticed an issue that most likely will
93 * not preclude a successful boot. To be used when something is wrong, and
94 * would likely be noticed by an end user.
95 *
96 * Example - Bad ME firmware, bad microcode, mis-clocked CPU
97 *
98 * @{
99 */
100#define BIOS_WARNING 4
101/** @} */
102
103/**
104 * \brief BIOS_NOTICE - Unexpected but relatively insignificant
105 *
106 * Log level for when the system has noticed an issue that is an edge case,
107 * but is handled and is recoverable. To be used when an end-user would likely
108 * not notice.
109 *
110 * Example - Hardware was misconfigured, but is promptly fixed.
111 *
112 * @{
113 */
114#define BIOS_NOTICE 5
115/** @} */
116
117/**
118 * \brief BIOS_INFO - Expected events.
119 *
120 * Log level for when the system has experienced some typical event.
121 * Messages should be superficial in nature.
122 *
123 * Example - Success messages. Status messages.
124 *
125 * @{
126 */
127#define BIOS_INFO 6
128/** @} */
129
130/**
131 * \brief BIOS_DEBUG - Verbose output
132 *
133 * Log level for details of a method. Messages may be dense,
134 * but should not be excessive. Messages should be detailed enough
135 * that this level provides sufficient details to diagnose a problem,
136 * but not necessarily enough to fix it.
137 *
138 * Example - Printing of important variables.
139 *
140 * @{
141 */
142#define BIOS_DEBUG 7
143/** @} */
144
145/**
146 * \brief BIOS_SPEW - Excessively verbose output
147 *
148 * Log level for intricacies of a method. Messages might contain raw
149 * data and will produce large logs. Developers should try to make sure
150 * that this level is not useful to anyone besides developers.
151 *
152 * Example - Data dumps.
153 *
154 * @{
155 */
156#define BIOS_SPEW 8
157/** @} */
158
159/**
160 * \brief BIOS_NEVER - Muted log level.
161 *
162 * Roughly equal to commenting out a printk statement. Because a user
163 * should not set their log level higher than 8, these statements
164 * are never printed.
165 *
166 * Example - A developer might locally define MY_LOGLEVEL to BIOS_SPEW,
167 * and later replace it with BIOS_NEVER as to mute their debug output.
168 *
169 * @{
170 */
171#define BIOS_NEVER 9
172/** @} */
Eric Biederman8ca8d762003-04-22 19:02:15 +0000173
174#endif /* LOGLEVEL_H */