KallistiOS  2.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Macros | Functions
dbglog.h File Reference

A debugging log. More...

#include <kos/cdefs.h>
#include <unistd.h>
#include <stdarg.h>
#include <kos/fs.h>

Go to the source code of this file.


#define DBG_DEAD   0
 The system is dead.
#define DBG_CRITICAL   1
 A critical error message.
#define DBG_ERROR   2
 A normal error message.
#define DBG_WARNING   3
 Potential problem.
#define DBG_NOTICE   4
 Normal but significant.
#define DBG_INFO   5
 Informational messages.
#define DBG_DEBUG   6
 User debug messages.
#define DBG_KDEBUG   7
 Kernel debug messages.


void dbglog (int level, const char *fmt,...) __printflike(2
 Kernel debugging printf.
void dbglog_set_level (int level)
 Set the debugging log level.

Detailed Description

A debugging log.

This file contains declarations related a debugging log. This log can be used to restrict log messages, for instance to make it so that only the most urgent of messages get printed for a release version of a program.

Dan Potter

Function Documentation

void dbglog ( int  level,
const char *  fmt,

Kernel debugging printf.

This function is similar to printf(), but filters its output through a log level check before being printed. This way, you can set the level of debug info you want to see (or want your users to see).

levelThe level of importance of this message.
fmtMessage format string.
...Format arguments
See also:
Log levels for dbglog
void dbglog_set_level ( int  level)

Set the debugging log level.

This function sets the level for which dbglog() will ignore messages for if the message has a higher level.

levelThe level to stop paying attention after.
See also:
Log levels for dbglog