-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogging.h
More file actions
48 lines (38 loc) · 1.27 KB
/
logging.h
File metadata and controls
48 lines (38 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// file: logging.h
// vim:fileencoding=utf-8:ft=c:tabstop=2
// This is free and unencumbered software released into the public domain.
//
// Author: R.F. Smith <rsmith@xs4all.nl>
// SPDX-License-Identifier: Unlicense
// Created: 2024-08-31 23:25:54 +0200
// Last modified: 2026-02-22T00:09:03+0100
#pragma once
enum {
LOG_NOTSET = 0,
LOG_CRITICAL = 10,
LOG_ERROR = 20,
LOG_WARNING = 30,
LOG_INFO = 40,
LOG_DEBUG = 50
};
#ifdef __cplusplus
extern "C" {
#endif
// Call this function before any of the other logging calls below.
// The “name” is prepended to each log message.
// Every message with a “level” equal or lower than the given value is printed.
// If “level” is 0, the logging level is set to LOG_WARNING.
extern void logging_configure(char *name, int level);
// Debug message. For developer infomation.
extern void debug(char *fmt, ...);
// Informational message.
extern void info(char *fmt, ...);
// An indication that something unexpected happened.
extern void warning(char *fmt, ...);
// Due to a more serious problem, the software has not been able to perform some function.
extern void error(char *fmt, ...);
// A problem so serious that the program cannot continue and will be aborted.
extern void critical(char *fmt, ...);
#ifdef __cplusplus
}
#endif