STASIS
A pipeline delivery generator
Loading...
Searching...
No Matches
src
lib
core
include
log.h
1
#ifndef STASIS_EXECPOINT_H
2
#define STASIS_EXECPOINT_H
3
4
#include <stdio.h>
5
6
enum
LogLevel {
7
LOG_LEVEL_WARN = 0,
8
LOG_LEVEL_INFO,
9
LOG_LEVEL_DEBUG,
10
};
11
extern
enum
LogLevel LOG_LEVEL;
12
13
struct
ExecPoint
{
14
const
int
line;
// line number
15
const
char
*file;
// file name of origin
16
const
char
*function;
// function of origin
17
};
18
19
#define EXECPOINT (struct ExecPoint) {.line = __LINE__, .file = __FILE__, .function = __func__}
20
21
void
log_print_error(
struct
ExecPoint
ep,
const
char
*fmt, ...);
22
void
log_print_warning(
struct
ExecPoint
ep,
const
char
*fmt, ...);
23
void
log_print_info(
struct
ExecPoint
ep,
const
char
*fmt, ...);
24
void
log_print_debug(
struct
ExecPoint
ep,
const
char
*fmt, ...);
25
int
log_msgv(FILE *stream,
struct
ExecPoint
ep,
const
char
*preface_color,
const
char
*preface,
const
char
*fmt, va_list ap);
26
int
log_msg(FILE *stream,
struct
ExecPoint
ep,
const
char
*preface_color,
const
char
*preface,
const
char
*fmt, ...);
27
const
char
*log_get_level_str(
void
);
28
29
#endif
// STASIS_EXECPOINT_H
ExecPoint
Definition
log.h:13
Generated by
1.13.2