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

#include <stdbool.h>
#include <pthread.h>

#include <osmocom/core/logging.h>

extern const struct log_info log_info;

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

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

#define CLOGCHAN(chan, category, level, fmt, args...) do { \
	LOGP(category, level, "[tid=%lu][chan=%lu] " fmt, pthread_self(), chan, ##args);  \
} while(0)