aboutsummaryrefslogtreecommitdiffstats
path: root/CommonLibs/debug.h
blob: ddb5c750538fa4fcaf636dcfd6f76b31440c3318 (plain)
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
#pragma once

#include <stdbool.h>

#include <osmocom/core/logging.h>
#include <osmocom/core/thread.h>

extern const struct log_info log_info;

/* Debug Areas of the code */
enum {
	DMAIN,
	DTRXCLK,
	DTRXCTRL,
	DTRXDDL,
	DTRXDUL,
	DDEV,
	DDEVDRV,
	DCTR,
};

#define CLOGC(category, level, fmt, args...) do { \
	LOGP(category, level, "[tid=%ld] " fmt, (long int) osmo_gettid(), ##args);  \
} while(0)

#define CLOGCHAN(chan, category, level, fmt, args...) do { \
	LOGP(category, level, "[tid=%ld][chan=%zu] " fmt, (long int) osmo_gettid(), chan, ##args);  \
} while(0)