KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
dbglog.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 kos/dbglog.h
4 Copyright (C)2004 Megan Potter
5
6*/
7
8/** \file kos/dbglog.h
9 \brief A debugging log.
10 \ingroup logging
11
12 This file contains declarations related a debugging log. This log can be
13 used to restrict log messages, for instance to make it so that only the most
14 urgent of messages get printed for a release version of a program.
15
16 \author Megan Potter
17*/
18
19#ifndef __KOS_DBGLOG_H
20#define __KOS_DBGLOG_H
21
22#include <kos/cdefs.h>
23__BEGIN_DECLS
24
25#include <unistd.h>
26#include <stdarg.h>
27#include <kos/fs.h>
28
29/** \defgroup logging Logging
30 \brief KOS's Logging API
31 \ingroup debugging
32*/
33
34/** \brief Kernel debugging printf.
35 \ingroup logging
36
37 This function is similar to printf(), but filters its output through a log
38 level check before being printed. This way, you can set the level of debug
39 info you want to see (or want your users to see).
40
41 \param level The level of importance of this message.
42 \param fmt Message format string.
43 \param ... Format arguments
44 \see dbglog_levels
45*/
46void dbglog(int level, const char *fmt, ...) __printflike(2, 3);
47
48/** \defgroup dbglog_levels Log Levels
49 \brief dbglog severity levels
50 \ingroup logging
51
52 This is the list of levels that are allowed to be passed into the dbglog()
53 function, representing different levels of importance.
54
55 @{
56*/
57#define DBG_DEAD 0 /**< \brief The system is dead */
58#define DBG_CRITICAL 1 /**< \brief A critical error message */
59#define DBG_ERROR 2 /**< \brief A normal error message */
60#define DBG_WARNING 3 /**< \brief Potential problem */
61#define DBG_NOTICE 4 /**< \brief Normal but significant */
62#define DBG_INFO 5 /**< \brief Informational messages */
63#define DBG_DEBUG 6 /**< \brief User debug messages */
64#define DBG_KDEBUG 7 /**< \brief Kernel debug messages */
65/** @} */
66
67/** \brief Set the debugging log level.
68 \ingroup logging
69
70 This function sets the level for which dbglog() will ignore messages for if
71 the message has a higher level.
72
73 \param level The level to stop paying attention after.
74 \see dbglog_levels
75*/
76void dbglog_set_level(int level);
77
78__END_DECLS
79
80#endif /* __KOS_DBGLOG_H */
81
Definitions for builtin attributes and compiler directives.
Virtual filesystem support.
void dbglog(int level, const char *fmt,...) __printflike(2
Kernel debugging printf.
void dbglog_set_level(int level)
Set the debugging log level.
#define __printflike(fmtarg, firstvararg)
Identify a function as accepting formatting like printf().
Definition cdefs.h:132