summaryrefslogtreecommitdiffstats
path: root/src/net/udp/syslog.c
diff options
context:
space:
mode:
authorMichael Brown2012-03-26 18:25:08 +0200
committerMichael Brown2012-03-26 18:40:01 +0200
commite024cd39a877ea1b37b9004dbd8f33448418cb36 (patch)
tree8bc44239bc5920d06b8381edef5aa37a4784aaf3 /src/net/udp/syslog.c
parent[console] Remove unused "btext" console (diff)
downloadipxe-e024cd39a877ea1b37b9004dbd8f33448418cb36.tar.gz
ipxe-e024cd39a877ea1b37b9004dbd8f33448418cb36.tar.xz
ipxe-e024cd39a877ea1b37b9004dbd8f33448418cb36.zip
[console] Allow usage to be defined independently for each console
Add the concept of a "console usage", such as "standard output" or "debug messages". Allow usages to be associated with each console independently. For example, to send debugging output via the serial port, while preventing it from appearing on the local console: #define CONSOLE_SERIAL CONSOLE_USAGE_ALL #define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_DEBUG ) If no usages are explicitly specified, then a default set of usages will be applied. For example: #define CONSOLE_SERIAL will have the same affect as #define CONSOLE_SERIAL CONSOLE_USAGE_ALL Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/udp/syslog.c')
-rw-r--r--src/net/udp/syslog.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/net/udp/syslog.c b/src/net/udp/syslog.c
index 5a8a865a..8788e1c4 100644
--- a/src/net/udp/syslog.c
+++ b/src/net/udp/syslog.c
@@ -34,6 +34,13 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/console.h>
#include <ipxe/lineconsole.h>
#include <ipxe/syslog.h>
+#include <config/console.h>
+
+/* Set default console usage if applicable */
+#if ! ( defined ( CONSOLE_SYSLOG ) && CONSOLE_EXPLICIT ( CONSOLE_SYSLOG ) )
+#undef CONSOLE_SYSLOG
+#define CONSOLE_SYSLOG CONSOLE_USAGE_ALL
+#endif
/** The syslog server */
static struct sockaddr_tcpip logserver = {
@@ -106,6 +113,7 @@ static void syslog_putchar ( int character ) {
struct console_driver syslog_console __console_driver = {
.putchar = syslog_putchar,
.disabled = 1,
+ .usage = CONSOLE_SYSLOG,
};
/******************************************************************************