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. More...
 
void log_printf (const char *fmt,...)
 Write message to system log. More...
 

Detailed Description

System logger.

Definition in file log.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ log_vprintf()

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.

42  {
43  int saved_usage;
44 
45  /* Mark console as in use for log messages */
47 
48  /* Print message */
49  vprintf ( fmt, args );
50 
51  /* Restore console usage */
53 }
#define CONSOLE_USAGE_LOG
Log messages.
Definition: console.h:150
static int console_set_usage(int usage)
Set console usage.
Definition: console.h:187
static unsigned int saved_usage
Definition: ansi_screen.c:13
int ssize_t const char * fmt
Definition: vsprintf.h:72
int vprintf(const char *fmt, va_list args)
Write a formatted string to the console.
Definition: vsprintf.c:449

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

Referenced by log_printf().

◆ log_printf()

void log_printf ( const char *  fmt,
  ... 
)

Write message to system log.

Parameters
fmtFormat string
...Arguments

Definition at line 61 of file log.c.

61  {
62  va_list args;
63 
64  va_start ( args, fmt );
65  log_vprintf ( fmt, args );
66  va_end ( args );
67 }
#define va_end(ap)
Definition: stdarg.h:9
__builtin_va_list va_list
Definition: stdarg.h:6
int ssize_t const char * fmt
Definition: vsprintf.h:72
void log_vprintf(const char *fmt, va_list args)
Write message to system log.
Definition: log.c:42
#define va_start(ap, last)
Definition: stdarg.h:7

References fmt, log_vprintf(), va_end, and va_start.