\doxysection{logging.\+h} \label{logging_8h_source}\index{include/osmocom/core/logging.h@{include/osmocom/core/logging.h}} \textbf{ Go to the documentation of this file.} \begin{DoxyCode}{0} \DoxyCodeLine{1 \textcolor{preprocessor}{\#pragma once}} \DoxyCodeLine{2 } \DoxyCodeLine{7 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{8 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{9 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{10 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{11 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{12 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{13 } \DoxyCodeLine{14 \textcolor{keyword}{extern} \textcolor{keyword}{struct }log\_info *osmo\_log\_info;} \DoxyCodeLine{15 } \DoxyCodeLine{16 \textcolor{preprocessor}{\#ifndef DEBUG}} \DoxyCodeLine{17 \textcolor{preprocessor}{\#define DEBUG}} \DoxyCodeLine{18 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{19 } \DoxyCodeLine{20 \textcolor{preprocessor}{\#ifdef LIBOSMOCORE\_NO\_LOGGING}} \DoxyCodeLine{21 \textcolor{preprocessor}{\#undef DEBUG}} \DoxyCodeLine{22 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{23 } \DoxyCodeLine{24 \textcolor{preprocessor}{\#ifdef DEBUG}} \DoxyCodeLine{30 \textcolor{preprocessor}{\#define DEBUGP(ss, fmt, args...) LOGP(ss, LOGL\_DEBUG, fmt, \#\#args)}} \DoxyCodeLine{31 \textcolor{preprocessor}{\#define DEBUGPC(ss, fmt, args...) LOGPC(ss, LOGL\_DEBUG, fmt, \#\#args)}} \DoxyCodeLine{32 \textcolor{preprocessor}{\#else}} \DoxyCodeLine{33 \textcolor{preprocessor}{\#define DEBUGP(xss, fmt, args...)}} \DoxyCodeLine{34 \textcolor{preprocessor}{\#define DEBUGPC(ss, fmt, args...)}} \DoxyCodeLine{35 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{36 } \DoxyCodeLine{37 } \DoxyCodeLine{38 \textcolor{keywordtype}{void} osmo\_vlogp(\textcolor{keywordtype}{int} subsys, \textcolor{keywordtype}{int} level, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *file, \textcolor{keywordtype}{int} line,} \DoxyCodeLine{39 \textcolor{keywordtype}{int} cont, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *format, va\_list ap);} \DoxyCodeLine{40 } \DoxyCodeLine{41 \textcolor{keywordtype}{void} logp(\textcolor{keywordtype}{int} subsys, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *file, \textcolor{keywordtype}{int} line, \textcolor{keywordtype}{int} cont, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *format, ...) OSMO\_DEPRECATED("{}Use DEBUGP* macros instead"{});} \DoxyCodeLine{42 } \DoxyCodeLine{49 \textcolor{preprocessor}{\#define LOGP(ss, level, fmt, args...) \(\backslash\)}} \DoxyCodeLine{50 \textcolor{preprocessor}{ LOGPSRC(ss, level, NULL, 0, fmt, \#\# args)}} \DoxyCodeLine{51 } \DoxyCodeLine{58 \textcolor{preprocessor}{\#ifndef LIBOSMOCORE\_NO\_LOGGING}} \DoxyCodeLine{59 \textcolor{preprocessor}{\#define LOGPC(ss, level, fmt, args...) \(\backslash\)}} \DoxyCodeLine{60 \textcolor{preprocessor}{ do \{ \(\backslash\)}} \DoxyCodeLine{61 \textcolor{preprocessor}{ if (!osmo\_log\_info) \{ \(\backslash\)}} \DoxyCodeLine{62 \textcolor{preprocessor}{ logp\_stub(\_\_FILE\_\_, \_\_LINE\_\_, 1, fmt, \#\#args); \(\backslash\)}} \DoxyCodeLine{63 \textcolor{preprocessor}{ break; \(\backslash\)}} \DoxyCodeLine{64 \textcolor{preprocessor}{ \} \(\backslash\)}} \DoxyCodeLine{65 \textcolor{preprocessor}{ if (log\_check\_level(ss, level)) \(\backslash\)}} \DoxyCodeLine{66 \textcolor{preprocessor}{ logp2(ss, level, \_\_FILE\_\_, \_\_LINE\_\_, 1, fmt, \#\#args); \(\backslash\)}} \DoxyCodeLine{67 \textcolor{preprocessor}{ \} while(0)}} \DoxyCodeLine{68 \textcolor{preprocessor}{\#else}} \DoxyCodeLine{69 \textcolor{preprocessor}{\#define LOGPC(ss, level, fmt, args...)}} \DoxyCodeLine{70 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{71 } \DoxyCodeLine{84 \textcolor{preprocessor}{\#define LOGPSRC(ss, level, caller\_file, caller\_line, fmt, args...) \(\backslash\)}} \DoxyCodeLine{85 \textcolor{preprocessor}{ LOGPSRCC(ss, level, caller\_file, caller\_line, 0, fmt, \#\#args)}} \DoxyCodeLine{86 } \DoxyCodeLine{100 \textcolor{preprocessor}{\#ifndef LIBOSMOCORE\_NO\_LOGGING}} \DoxyCodeLine{101 \textcolor{preprocessor}{\#define LOGPSRCC(ss, level, caller\_file, caller\_line, cont, fmt, args...) \(\backslash\)}} \DoxyCodeLine{102 \textcolor{preprocessor}{ do \{ \(\backslash\)}} \DoxyCodeLine{103 \textcolor{preprocessor}{ if (!osmo\_log\_info) \{ \(\backslash\)}} \DoxyCodeLine{104 \textcolor{preprocessor}{ if (caller\_file) \(\backslash\)}} \DoxyCodeLine{105 \textcolor{preprocessor}{ logp\_stub(caller\_file, caller\_line, cont, fmt, \#\#args); \(\backslash\)}} \DoxyCodeLine{106 \textcolor{preprocessor}{ else \(\backslash\)}} \DoxyCodeLine{107 \textcolor{preprocessor}{ logp\_stub(\_\_FILE\_\_, \_\_LINE\_\_, cont, fmt, \#\#args); \(\backslash\)}} \DoxyCodeLine{108 \textcolor{preprocessor}{ break; \(\backslash\)}} \DoxyCodeLine{109 \textcolor{preprocessor}{ \} \(\backslash\)}} \DoxyCodeLine{110 \textcolor{preprocessor}{ if (log\_check\_level(ss, level)) \{\(\backslash\)}} \DoxyCodeLine{111 \textcolor{preprocessor}{ if (caller\_file) \(\backslash\)}} \DoxyCodeLine{112 \textcolor{preprocessor}{ logp2(ss, level, caller\_file, caller\_line, cont, fmt, \#\#args); \(\backslash\)}} \DoxyCodeLine{113 \textcolor{preprocessor}{ else \(\backslash\)}} \DoxyCodeLine{114 \textcolor{preprocessor}{ logp2(ss, level, \_\_FILE\_\_, \_\_LINE\_\_, cont, fmt, \#\#args); \(\backslash\)}} \DoxyCodeLine{115 \textcolor{preprocessor}{ \}\(\backslash\)}} \DoxyCodeLine{116 \textcolor{preprocessor}{ \} while(0)}} \DoxyCodeLine{117 \textcolor{preprocessor}{\#else}} \DoxyCodeLine{118 \textcolor{preprocessor}{\#define LOGPSRCC(ss, level, caller\_file, caller\_line, cont, fmt, args...)}} \DoxyCodeLine{119 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{120 } \DoxyCodeLine{122 \textcolor{preprocessor}{\#define LOGL\_DEBUG 1 }} \DoxyCodeLine{123 \textcolor{preprocessor}{\#define LOGL\_INFO 3 }} \DoxyCodeLine{124 \textcolor{preprocessor}{\#define LOGL\_NOTICE 5 }} \DoxyCodeLine{125 \textcolor{preprocessor}{\#define LOGL\_ERROR 7 }} \DoxyCodeLine{126 \textcolor{preprocessor}{\#define LOGL\_FATAL 8 }} \DoxyCodeLine{128 \textcolor{comment}{/* logging subsystems defined by the library itself */}} \DoxyCodeLine{129 \textcolor{preprocessor}{\#define DLGLOBAL -\/1 }} \DoxyCodeLine{130 \textcolor{preprocessor}{\#define DLLAPD -\/2 }} \DoxyCodeLine{131 \textcolor{preprocessor}{\#define DLINP -\/3 }} \DoxyCodeLine{132 \textcolor{preprocessor}{\#define DLMUX -\/4 }} \DoxyCodeLine{133 \textcolor{preprocessor}{\#define DLMI -\/5 }} \DoxyCodeLine{134 \textcolor{preprocessor}{\#define DLMIB -\/6 }} \DoxyCodeLine{135 \textcolor{preprocessor}{\#define DLSMS -\/7 }} \DoxyCodeLine{136 \textcolor{preprocessor}{\#define DLCTRL -\/8 }} \DoxyCodeLine{137 \textcolor{preprocessor}{\#define DLGTP -\/9 }} \DoxyCodeLine{138 \textcolor{preprocessor}{\#define DLSTATS -\/10 }} \DoxyCodeLine{139 \textcolor{preprocessor}{\#define DLGSUP -\/11 }} \DoxyCodeLine{140 \textcolor{preprocessor}{\#define DLOAP -\/12 }} \DoxyCodeLine{141 \textcolor{preprocessor}{\#define DLSS7 -\/13 }} \DoxyCodeLine{142 \textcolor{preprocessor}{\#define DLSCCP -\/14 }} \DoxyCodeLine{143 \textcolor{preprocessor}{\#define DLSUA -\/15 }} \DoxyCodeLine{144 \textcolor{preprocessor}{\#define DLM3UA -\/16 }} \DoxyCodeLine{145 \textcolor{preprocessor}{\#define DLMGCP -\/17 }} \DoxyCodeLine{146 \textcolor{preprocessor}{\#define DLJIBUF -\/18 }} \DoxyCodeLine{147 \textcolor{preprocessor}{\#define DLRSPRO -\/19 }} \DoxyCodeLine{148 \textcolor{preprocessor}{\#define DLNS -\/20 }} \DoxyCodeLine{149 \textcolor{preprocessor}{\#define DLBSSGP -\/21 }} \DoxyCodeLine{150 \textcolor{preprocessor}{\#define DLNSDATA -\/22 }} \DoxyCodeLine{151 \textcolor{preprocessor}{\#define DLNSSIGNAL -\/23 }} \DoxyCodeLine{152 \textcolor{preprocessor}{\#define DLIUUP -\/24 }} \DoxyCodeLine{153 \textcolor{preprocessor}{\#define DLPFCP -\/25 }} \DoxyCodeLine{154 \textcolor{preprocessor}{\#define DLCSN1 -\/26 }} \DoxyCodeLine{155 \textcolor{preprocessor}{\#define DLM2PA -\/27 }} \DoxyCodeLine{156 \textcolor{preprocessor}{\#define DLM2UA -\/28 }} \DoxyCodeLine{157 \textcolor{preprocessor}{\#define DLIO -\/29 }} \DoxyCodeLine{158 \textcolor{preprocessor}{\#define OSMO\_NUM\_DLIB 29 }} \DoxyCodeLine{160 \textcolor{comment}{/* Colors that can be used in log\_info\_cat.color */}} \DoxyCodeLine{161 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_NORMAL NULL}} \DoxyCodeLine{162 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_RED "{}\(\backslash\)033[1;31m"{}}} \DoxyCodeLine{163 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_GREEN "{}\(\backslash\)033[1;32m"{}}} \DoxyCodeLine{164 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_YELLOW "{}\(\backslash\)033[1;33m"{}}} \DoxyCodeLine{165 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_BLUE "{}\(\backslash\)033[1;34m"{}}} \DoxyCodeLine{166 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_PURPLE "{}\(\backslash\)033[1;35m"{}}} \DoxyCodeLine{167 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_CYAN "{}\(\backslash\)033[1;36m"{}}} \DoxyCodeLine{168 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_DARKRED "{}\(\backslash\)033[31m"{}}} \DoxyCodeLine{169 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_DARKGREEN "{}\(\backslash\)033[32m"{}}} \DoxyCodeLine{170 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_DARKYELLOW "{}\(\backslash\)033[33m"{}}} \DoxyCodeLine{171 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_DARKBLUE "{}\(\backslash\)033[34m"{}}} \DoxyCodeLine{172 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_DARKPURPLE "{}\(\backslash\)033[35m"{}}} \DoxyCodeLine{173 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_DARKCYAN "{}\(\backslash\)033[36m"{}}} \DoxyCodeLine{174 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_DARKGREY "{}\(\backslash\)033[1;30m"{}}} \DoxyCodeLine{175 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_GREY "{}\(\backslash\)033[37m"{}}} \DoxyCodeLine{176 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_BRIGHTWHITE "{}\(\backslash\)033[1;37m"{}}} \DoxyCodeLine{177 \textcolor{preprocessor}{\#define OSMO\_LOGCOLOR\_END "{}\(\backslash\)033[0;m"{}}} \DoxyCodeLine{178 } \DoxyCodeLine{180 \textcolor{keyword}{struct }log\_category \{} \DoxyCodeLine{181 uint8\_t loglevel; } \DoxyCodeLine{182 uint8\_t enabled; } \DoxyCodeLine{183 \};} \DoxyCodeLine{184 } \DoxyCodeLine{186 \textcolor{keyword}{struct }log\_info\_cat \{} \DoxyCodeLine{187 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name; } \DoxyCodeLine{188 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *color; } \DoxyCodeLine{189 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *description; } \DoxyCodeLine{190 uint8\_t loglevel; } \DoxyCodeLine{191 uint8\_t enabled; } \DoxyCodeLine{192 \};} \DoxyCodeLine{193 } \DoxyCodeLine{196 \textcolor{keyword}{enum} log\_ctx\_index \{} \DoxyCodeLine{197 LOG\_CTX\_GB\_NSVC,} \DoxyCodeLine{198 LOG\_CTX\_GB\_BVC,} \DoxyCodeLine{199 LOG\_CTX\_BSC\_SUBSCR,} \DoxyCodeLine{200 LOG\_CTX\_VLR\_SUBSCR,} \DoxyCodeLine{201 LOG\_CTX\_L1\_SAPI,} \DoxyCodeLine{202 LOG\_CTX\_GB\_NSE,} \DoxyCodeLine{203 \_LOG\_CTX\_COUNT} \DoxyCodeLine{204 \};} \DoxyCodeLine{205 } \DoxyCodeLine{209 \textcolor{keyword}{enum} log\_filter\_index \{} \DoxyCodeLine{210 LOG\_FLT\_ALL,} \DoxyCodeLine{211 LOG\_FLT\_GB\_NSVC,} \DoxyCodeLine{212 LOG\_FLT\_GB\_BVC,} \DoxyCodeLine{213 LOG\_FLT\_BSC\_SUBSCR,} \DoxyCodeLine{214 LOG\_FLT\_VLR\_SUBSCR,} \DoxyCodeLine{215 LOG\_FLT\_L1\_SAPI,} \DoxyCodeLine{216 LOG\_FLT\_GB\_NSE,} \DoxyCodeLine{217 \_LOG\_FLT\_COUNT} \DoxyCodeLine{218 \};} \DoxyCodeLine{219 } \DoxyCodeLine{221 \textcolor{preprocessor}{\#define LOG\_MAX\_CTX \_LOG\_CTX\_COUNT}} \DoxyCodeLine{223 \textcolor{preprocessor}{\#define LOG\_MAX\_FILTERS \_LOG\_FLT\_COUNT}} \DoxyCodeLine{224 } \DoxyCodeLine{226 \textcolor{keyword}{struct }log\_context \{} \DoxyCodeLine{227 \textcolor{keywordtype}{void} *ctx[LOG\_MAX\_CTX+1];} \DoxyCodeLine{228 \};} \DoxyCodeLine{229 } \DoxyCodeLine{231 \textcolor{preprocessor}{\#define LOG\_FILTER\_ALL (1<'? */}} \DoxyCodeLine{390 \textcolor{keywordtype}{bool} print\_category\_hex;} \DoxyCodeLine{391 \textcolor{comment}{/* Should we print the source file and line, and in which way? */}} \DoxyCodeLine{392 \textcolor{keyword}{enum} log\_filename\_type print\_filename2;} \DoxyCodeLine{393 \textcolor{comment}{/* Where on a log line to put the source file info. */}} \DoxyCodeLine{394 \textcolor{keyword}{enum} log\_filename\_pos print\_filename\_pos;} \DoxyCodeLine{395 \};} \DoxyCodeLine{396 } \DoxyCodeLine{397 \textcolor{comment}{/* use the above macros */}} \DoxyCodeLine{398 \textcolor{keywordtype}{void} logp2(\textcolor{keywordtype}{int} subsys, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} level, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *file,} \DoxyCodeLine{399 \textcolor{keywordtype}{int} line, \textcolor{keywordtype}{int} cont, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *format, ...)} \DoxyCodeLine{400 \_\_attribute\_\_ ((format (printf, 6, 7)));} \DoxyCodeLine{401 \textcolor{keywordtype}{void} logp\_stub(const \textcolor{keywordtype}{char} *file, \textcolor{keywordtype}{int} line, \textcolor{keywordtype}{int} cont, const \textcolor{keywordtype}{char} *format, ...);} \DoxyCodeLine{402 \textcolor{keywordtype}{int} log\_init(const struct log\_info *inf, \textcolor{keywordtype}{void} *talloc\_ctx);} \DoxyCodeLine{403 \textcolor{keywordtype}{void} log\_fini(\textcolor{keywordtype}{void});} \DoxyCodeLine{404 \textcolor{keywordtype}{int} log\_check\_level(\textcolor{keywordtype}{int} subsys, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} level);} \DoxyCodeLine{405 } \DoxyCodeLine{406 \textcolor{comment}{/* context management */}} \DoxyCodeLine{407 \textcolor{keywordtype}{void} log\_reset\_context(\textcolor{keywordtype}{void});} \DoxyCodeLine{408 \textcolor{keywordtype}{int} log\_set\_context(uint8\_t ctx, \textcolor{keywordtype}{void} *value);} \DoxyCodeLine{409 } \DoxyCodeLine{410 \textcolor{comment}{/* filter on the targets */}} \DoxyCodeLine{411 \textcolor{keywordtype}{void} log\_set\_all\_filter(struct log\_target *target, \textcolor{keywordtype}{int});} \DoxyCodeLine{412 } \DoxyCodeLine{413 \textcolor{keywordtype}{void} log\_set\_use\_color(struct log\_target *target, \textcolor{keywordtype}{int});} \DoxyCodeLine{414 \textcolor{keywordtype}{void} log\_set\_print\_extended\_timestamp(struct log\_target *target, \textcolor{keywordtype}{int});} \DoxyCodeLine{415 \textcolor{keywordtype}{void} log\_set\_print\_timestamp(struct log\_target *target, \textcolor{keywordtype}{int});} \DoxyCodeLine{416 \textcolor{keywordtype}{void} log\_set\_print\_tid(struct log\_target *target, \textcolor{keywordtype}{int});} \DoxyCodeLine{417 \textcolor{keywordtype}{void} log\_set\_print\_filename(struct log\_target *target, \textcolor{keywordtype}{int}) OSMO\_DEPRECATED("{}Use log\_set\_print\_filename2() instead"{});} \DoxyCodeLine{418 \textcolor{keywordtype}{void} log\_set\_print\_filename2(struct log\_target *target, enum log\_filename\_type lft);} \DoxyCodeLine{419 \textcolor{keywordtype}{void} log\_set\_print\_filename\_pos(struct log\_target *target, enum log\_filename\_pos pos);} \DoxyCodeLine{420 \textcolor{keywordtype}{void} log\_set\_print\_category(struct log\_target *target, \textcolor{keywordtype}{int});} \DoxyCodeLine{421 \textcolor{keywordtype}{void} log\_set\_print\_category\_hex(struct log\_target *target, \textcolor{keywordtype}{int});} \DoxyCodeLine{422 \textcolor{keywordtype}{void} log\_set\_print\_level(struct log\_target *target, \textcolor{keywordtype}{int});} \DoxyCodeLine{423 \textcolor{keywordtype}{void} log\_set\_log\_level(struct log\_target *target, \textcolor{keywordtype}{int} log\_level);} \DoxyCodeLine{424 \textcolor{keywordtype}{void} log\_parse\_category\_mask(struct log\_target *target, const \textcolor{keywordtype}{char}* mask);} \DoxyCodeLine{425 const \textcolor{keywordtype}{char}* log\_category\_name(\textcolor{keywordtype}{int} subsys);} \DoxyCodeLine{426 \textcolor{keywordtype}{int} log\_parse\_level(const \textcolor{keywordtype}{char} *lvl) OSMO\_DEPRECATED\_OUTSIDE\_LIBOSMOCORE;} \DoxyCodeLine{427 const \textcolor{keywordtype}{char} *log\_level\_str(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} lvl) OSMO\_DEPRECATED\_OUTSIDE\_LIBOSMOCORE;} \DoxyCodeLine{428 \textcolor{keywordtype}{int} log\_parse\_category(const \textcolor{keywordtype}{char} *category);} \DoxyCodeLine{429 \textcolor{keywordtype}{void} log\_set\_category\_filter(struct log\_target *target, \textcolor{keywordtype}{int} category,} \DoxyCodeLine{430 \textcolor{keywordtype}{int} enable, \textcolor{keywordtype}{int} level);} \DoxyCodeLine{431 } \DoxyCodeLine{432 \textcolor{comment}{/* management of the targets */}} \DoxyCodeLine{433 struct log\_target *log\_target\_create(\textcolor{keywordtype}{void});} \DoxyCodeLine{434 \textcolor{keywordtype}{void} log\_target\_destroy(struct log\_target *target);} \DoxyCodeLine{435 struct log\_target *log\_target\_create\_stderr(\textcolor{keywordtype}{void});} \DoxyCodeLine{436 struct log\_target *log\_target\_create\_file(const \textcolor{keywordtype}{char} *fname);} \DoxyCodeLine{437 struct log\_target *log\_target\_create\_syslog(const \textcolor{keywordtype}{char} *ident, \textcolor{keywordtype}{int} option,} \DoxyCodeLine{438 \textcolor{keywordtype}{int} facility);} \DoxyCodeLine{439 struct log\_target *log\_target\_create\_gsmtap(const \textcolor{keywordtype}{char} *host, uint16\_t port,} \DoxyCodeLine{440 const \textcolor{keywordtype}{char} *ident,} \DoxyCodeLine{441 \textcolor{keywordtype}{bool} ofd\_wq\_mode,} \DoxyCodeLine{442 \textcolor{keywordtype}{bool} add\_sink);} \DoxyCodeLine{443 struct log\_target *log\_target\_create\_systemd(\textcolor{keywordtype}{bool} raw);} \DoxyCodeLine{444 \textcolor{keywordtype}{void} log\_target\_systemd\_set\_raw(struct log\_target *target, \textcolor{keywordtype}{bool} raw);} \DoxyCodeLine{445 \textcolor{keywordtype}{int} log\_target\_file\_reopen(struct log\_target *tgt);} \DoxyCodeLine{446 \textcolor{keywordtype}{int} log\_target\_file\_switch\_to\_stream(struct log\_target *tgt);} \DoxyCodeLine{447 \textcolor{keywordtype}{int} log\_target\_file\_switch\_to\_wqueue(struct log\_target *tgt);} \DoxyCodeLine{448 \textcolor{keywordtype}{int} log\_targets\_reopen(\textcolor{keywordtype}{void});} \DoxyCodeLine{449 } \DoxyCodeLine{450 \textcolor{keywordtype}{void} log\_add\_target(struct log\_target *target);} \DoxyCodeLine{451 \textcolor{keywordtype}{void} log\_del\_target(struct log\_target *target);} \DoxyCodeLine{452 } \DoxyCodeLine{453 struct log\_target *log\_target\_find(enum log\_target\_type type, const \textcolor{keywordtype}{char} *fname);} \DoxyCodeLine{454 } \DoxyCodeLine{455 \textcolor{keywordtype}{void} log\_enable\_multithread(\textcolor{keywordtype}{void});} \DoxyCodeLine{456 } \DoxyCodeLine{457 \textcolor{keywordtype}{void} log\_tgt\_mutex\_lock\_impl(\textcolor{keywordtype}{void});} \DoxyCodeLine{458 \textcolor{keywordtype}{void} log\_tgt\_mutex\_unlock\_impl(\textcolor{keywordtype}{void});} \DoxyCodeLine{459 \textcolor{preprocessor}{\#define LOG\_MTX\_DEBUG 0}} \DoxyCodeLine{460 \textcolor{preprocessor}{\#if LOG\_MTX\_DEBUG}} \DoxyCodeLine{461 \textcolor{preprocessor}{ \#include }} \DoxyCodeLine{462 \textcolor{preprocessor}{ \#define log\_tgt\_mutex\_lock() do \{ fprintf(stderr, "{}[\%lu] \%s:\%d [\%s] lock\(\backslash\)n"{}}, pthread\_self(), \_\_FILE\_\_, \_\_LINE\_\_, \_\_func\_\_); log\_tgt\_mutex\_lock\_impl(); \} while (0)} \DoxyCodeLine{463 \textcolor{preprocessor}{ \#define log\_tgt\_mutex\_unlock() do \{ fprintf(stderr, "{}[\%lu] \%s:\%d [\%s] unlock\(\backslash\)n"{}}, pthread\_self(), \_\_FILE\_\_, \_\_LINE\_\_, \_\_func\_\_); log\_tgt\_mutex\_unlock\_impl(); \} while (0)} \DoxyCodeLine{464 \textcolor{preprocessor}{\#else}} \DoxyCodeLine{465 \textcolor{preprocessor}{ \#define log\_tgt\_mutex\_lock() log\_tgt\_mutex\_lock\_impl()}} \DoxyCodeLine{466 \textcolor{preprocessor}{ \#define log\_tgt\_mutex\_unlock() log\_tgt\_mutex\_unlock\_impl()}} \DoxyCodeLine{467 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{468 } \end{DoxyCode}