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/** \defgroup logging Logging
26 \brief KOS's Logging API
27 \ingroup debugging
28*/
29
30/** \brief Kernel debugging printf.
31 \ingroup logging
32
33 This function is similar to printf(), but filters its output through a log
34 level check before being printed. This way, you can set the level of debug
35 info you want to see (or want your users to see).
36
37 \param level The level of importance of this message.
38 \param fmt Message format string.
39 \param ... Format arguments
40 \see dbglog_levels
41*/
42void dbglog(int level, const char *fmt, ...) __printflike(2, 3);
43
44/** \defgroup dbglog_levels Log Levels
45 \brief dbglog severity levels
46 \ingroup logging
47
48 This is the list of levels that are allowed to be passed into the dbglog()
49 function, representing different levels of importance.
50
51 @{
52*/
53#define DBG_DEAD 0 /**< \brief The system is dead */
54#define DBG_CRITICAL 1 /**< \brief A critical error message */
55#define DBG_ERROR 2 /**< \brief A normal error message */
56#define DBG_WARNING 3 /**< \brief Potential problem */
57#define DBG_NOTICE 4 /**< \brief Normal but significant */
58#define DBG_INFO 5 /**< \brief Informational messages */
59#define DBG_DEBUG 6 /**< \brief User debug messages */
60#define DBG_KDEBUG 7 /**< \brief Kernel debug messages */
61/** @} */
62
63/** \brief Set the debugging log level.
64 \ingroup logging
65
66 This function sets the level for which dbglog() will ignore messages for if
67 the message has a higher level.
68
69 \param level The level to stop paying attention after.
70 \see dbglog_levels
71*/
72void dbglog_set_level(int level);
73
74__END_DECLS
75
76#endif /* __KOS_DBGLOG_H */
77
Various common macros used throughout the codebase.
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:139