mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
log: Add a console driver
It is useful to display log messages on the console. Add a simple driver to handle this. Note that this driver outputs to the console, which may be serial or video. It does not specifically select serial output. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
23
common/log_console.c
Normal file
23
common/log_console.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Logging support
|
||||
*
|
||||
* Copyright (c) 2017 Google, Inc
|
||||
* Written by Simon Glass <sjg@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <log.h>
|
||||
|
||||
static int log_console_emit(struct log_device *ldev, struct log_rec *rec)
|
||||
{
|
||||
puts(rec->msg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
LOG_DRIVER(console) = {
|
||||
.name = "console",
|
||||
.emit = log_console_emit,
|
||||
};
|
Reference in New Issue
Block a user