iPXE
Functions
log.c File Reference

System logger. More...

#include <stdarg.h>
#include <syslog.h>
#include <ipxe/console.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
void log_vprintf (const char *fmt, va_list args)
 Write message to system log.
void log_printf (const char *fmt,...)
 Write message to system log.

Detailed Description

System logger.

Definition in file log.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
void log_vprintf ( const char *  fmt,
va_list  args 
)

Write message to system log.

Parameters:
fmtFormat string
argsArguments

Definition at line 42 of file log.c.

References console_set_usage(), CONSOLE_USAGE_LOG, saved_usage, and vprintf().

Referenced by log_printf().

                                                   {
        int saved_usage;

        /* Mark console as in use for log messages */
        saved_usage = console_set_usage ( CONSOLE_USAGE_LOG );

        /* Print message */
        vprintf ( fmt, args );

        /* Restore console usage */
        console_set_usage ( saved_usage );
}
void log_printf ( const char *  fmt,
  ... 
)

Write message to system log.

Parameters:
fmtFormat string
...Arguments

Definition at line 61 of file log.c.

References log_vprintf(), va_end, and va_start.

                                         {
        va_list args;

        va_start ( args, fmt );
        log_vprintf ( fmt, args );
        va_end ( args );
}