aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-12-20 00:00:11 +0100
committerHarald Welte <laforge@gnumonks.org>2018-12-23 10:08:55 +0000
commite5bde9053238ba8fdce9797f97d76016abf474f7 (patch)
tree39c3e3e5df65811397e6e87c2ae3bb6e571b1091 /include/osmocom/core
parent34d54b2ba7968d239bfb2fbc70bcb775c1467969 (diff)
define LOGPFSM fmt only once, in LOGPFSMLSRC
Instead of duplicating the fmt and args in LOGPFSML and LOGPFSMLSRC, rather make LOGPFSML invoke LOGPFSMLSRC with __FILE__ and __LINE__. This is a cosmetic preparation for more tweaks coming up. Change-Id: I2f23c57ebfdb5355919c06ac5ded7732e3b17a97
Diffstat (limited to 'include/osmocom/core')
-rw-r--r--include/osmocom/core/fsm.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h
index 54bbad5..ee71451 100644
--- a/include/osmocom/core/fsm.h
+++ b/include/osmocom/core/fsm.h
@@ -120,13 +120,7 @@ struct osmo_fsm_inst {
void osmo_fsm_log_addr(bool log_addr);
#define LOGPFSML(fi, level, fmt, args...) \
- LOGP((fi)->fsm->log_subsys, OSMO_MAX(level, (fi)->log_level), \
- "%s{%s}: " fmt, \
- osmo_fsm_inst_name(fi), \
- osmo_fsm_state_name((fi)->fsm, (fi)->state), ## args)
-
-#define LOGPFSM(fi, fmt, args...) \
- LOGPFSML(fi, (fi)->log_level, fmt, ## args)
+ LOGPFSMLSRC(fi, level, __FILE__, __LINE__, fmt, ## args)
#define LOGPFSMLSRC(fi, level, caller_file, caller_line, fmt, args...) \
LOGPSRC((fi)->fsm->log_subsys, level, \
@@ -136,6 +130,9 @@ void osmo_fsm_log_addr(bool log_addr);
osmo_fsm_state_name((fi)->fsm, (fi)->state), \
## args)
+#define LOGPFSM(fi, fmt, args...) \
+ LOGPFSML(fi, (fi)->log_level, fmt, ## args)
+
#define LOGPFSMSRC(fi, caller_file, caller_line, fmt, args...) \
LOGPFSMLSRC(fi, (fi)->log_level, \
caller_file, caller_line, \