KallistiOS  ##version##
 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.

Macros

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

Functions

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

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.

Author
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).

Parameters
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.

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