tree: drop last paragraph of GPL copyright header
[coreboot.git] / util / cbfstool / console / console.h
blob8e4fbc27e2a6b69db8108de81088def5189a9d0e
1 /*
2 * This file is part of the coreboot project.
4 * Copyright 2015 Google Inc.
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; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef _CBFSTOOL_CONSOLE_H_
17 #define _CBFSTOOL_CONSOLE_H_
19 #include <stdio.h>
20 #include <commonlib/loglevel.h>
22 /* Message output */
23 extern int verbose;
24 #define ERROR(...) { fprintf(stderr, "E: " __VA_ARGS__); }
25 #define WARN(...) { fprintf(stderr, "W: " __VA_ARGS__); }
26 #define LOG(...) { fprintf(stderr, __VA_ARGS__); }
27 #define INFO(...) { if (verbose > 0) fprintf(stderr, "INFO: " __VA_ARGS__); }
28 #define DEBUG(...) { if (verbose > 1) fprintf(stderr, "DEBUG: " __VA_ARGS__); }
31 #define printk(lvl, ...) \
32 { \
33 if ((lvl) <= BIOS_ERR) { \
34 ERROR(__VA_ARGS__); \
35 } else if ((lvl) <= BIOS_NOTICE) { \
36 WARN(__VA_ARGS__); \
37 } else if ((lvl) <= BIOS_INFO) { \
38 INFO(__VA_ARGS__); \
39 } else if ((lvl) <= BIOS_DEBUG) { \
40 DEBUG(__VA_ARGS__); \
41 } \
44 #endif