summaryrefslogtreecommitdiffstats
path: root/cli_output.c
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2017-06-19 12:57:10 +0200
committerNico Huber <nico.h@gmx.de>2017-07-13 16:27:55 +0000
commitd152fb95e2b7fda62a85f6c8e4112ba9f353a8d6 (patch)
treecfd2ea28b75cb90db72f488ee237a068d0cb52a4 /cli_output.c
parent731316a9128c4015bc0facd1743afeb3a080129e (diff)
downloadflashrom-d152fb95e2b7fda62a85f6c8e4112ba9f353a8d6.tar.gz
flashrom-d152fb95e2b7fda62a85f6c8e4112ba9f353a8d6.tar.bz2
flashrom-d152fb95e2b7fda62a85f6c8e4112ba9f353a8d6.zip
Drop redundant `enum msglevel`
Use `enum flashrom_log_level` instead to avoid further confusion. Change-Id: I1895cb8f60da3abf70c9c2953f52414cd2cc10a9 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/20268 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'cli_output.c')
-rw-r--r--cli_output.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/cli_output.c b/cli_output.c
index e69798503..61a9af6ed 100644
--- a/cli_output.c
+++ b/cli_output.c
@@ -25,8 +25,8 @@
#include <errno.h>
#include "flash.h"
-int verbose_screen = MSG_INFO;
-int verbose_logfile = MSG_DEBUG2;
+enum flashrom_log_level verbose_screen = FLASHROM_MSG_INFO;
+enum flashrom_log_level verbose_logfile = FLASHROM_MSG_DEBUG2;
#ifndef STANDALONE
static FILE *logfile = NULL;
@@ -61,17 +61,17 @@ int open_logfile(const char * const filename)
void start_logging(void)
{
- enum msglevel oldverbose_screen = verbose_screen;
+ enum flashrom_log_level oldverbose_screen = verbose_screen;
/* Shut up the console. */
- verbose_screen = MSG_ERROR;
+ verbose_screen = FLASHROM_MSG_ERROR;
print_version();
verbose_screen = oldverbose_screen;
}
#endif /* !STANDALONE */
/* Please note that level is the verbosity, not the importance of the message. */
-int flashrom_print_cb(enum msglevel level, const char *fmt, va_list ap)
+int flashrom_print_cb(enum flashrom_log_level level, const char *fmt, va_list ap)
{
int ret = 0;
FILE *output_type = stdout;
@@ -79,20 +79,20 @@ int flashrom_print_cb(enum msglevel level, const char *fmt, va_list ap)
va_list logfile_args;
va_copy(logfile_args, ap);
- if (level < MSG_INFO)
+ if (level < FLASHROM_MSG_INFO)
output_type = stderr;
if (level <= verbose_screen) {
ret = vfprintf(output_type, fmt, ap);
/* msg_*spew often happens inside chip accessors in possibly
* time-critical operations. Don't slow them down by flushing. */
- if (level != MSG_SPEW)
+ if (level != FLASHROM_MSG_SPEW)
fflush(output_type);
}
#ifndef STANDALONE
if ((level <= verbose_logfile) && logfile) {
ret = vfprintf(logfile, fmt, logfile_args);
- if (level != MSG_SPEW)
+ if (level != FLASHROM_MSG_SPEW)
fflush(logfile);
}
#endif /* !STANDALONE */