1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef _CBFSTOOL_CONSOLE_H_
4 #define _CBFSTOOL_CONSOLE_H_
7 #include <commonlib/loglevel.h>
11 #define ERROR(...) fprintf(stderr, "E: " __VA_ARGS__)
12 #define WARN(...) fprintf(stderr, "W: " __VA_ARGS__)
13 #define LOG(...) fprintf(stderr, __VA_ARGS__)
14 #define INFO(...) do { if (verbose > 0) fprintf(stderr, "INFO: " __VA_ARGS__); } while (0)
15 #define DEBUG(...) do { if (verbose > 1) fprintf(stderr, "DEBUG: " __VA_ARGS__); } while (0)
18 #define printk(lvl, ...) \
20 if ((lvl) <= BIOS_ERR) { \
22 } else if ((lvl) <= BIOS_NOTICE) { \
24 } else if ((lvl) <= BIOS_INFO) { \
26 } else if ((lvl) <= BIOS_DEBUG) { \