\doxysection{Osmocom logging internals}
\label{group__logging__internal}\index{Osmocom logging internals@{Osmocom logging internals}}
\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ logging\+\_\+internal.\+h}
\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ log\+\_\+thread\+\_\+state}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ MAX\+\_\+\+LOG\+\_\+\+SIZE}~4096
\item 
\#define \textbf{ LOG\+\_\+\+WQUEUE\+\_\+\+LEN}~156
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ assert\+\_\+loginfo} (const char $\ast$src)
\item 
int \textbf{ log\+\_\+output\+\_\+buf} (char $\ast$buf, int buf\+\_\+len, struct \textbf{ log\+\_\+target} $\ast$target, unsigned int \textbf{ subsys}, unsigned int \textbf{ level}, const char $\ast$\textbf{ file}, int line, int cont, const char $\ast$format, va\+\_\+list ap)
\begin{DoxyCompactList}\small\item\em main output formatting function for log lines. \end{DoxyCompactList}\item 
void \textbf{ log\+\_\+target\+\_\+file\+\_\+destroy} (struct \textbf{ log\+\_\+target} $\ast$target)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
void $\ast$ \textbf{ tall\+\_\+log\+\_\+ctx}
\item 
struct \textbf{ log\+\_\+info} $\ast$ \textbf{ osmo\+\_\+log\+\_\+info}
\item 
const struct \textbf{ value\+\_\+string} \textbf{ loglevel\+\_\+strs} [$\,$]
\item 
struct \textbf{ llist\+\_\+head} \textbf{ osmo\+\_\+log\+\_\+target\+\_\+list}
\item 
\+\_\+\+\_\+thread struct \textbf{ log\+\_\+thread\+\_\+state} \textbf{ log\+\_\+thread\+\_\+state}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


\doxysubsection{Macro Definition Documentation}
\mbox{\label{group__logging__internal_gaf04b3072636350a4b12b5e7ece065c72}} 
\index{Osmocom logging internals@{Osmocom logging internals}!LOG\_WQUEUE\_LEN@{LOG\_WQUEUE\_LEN}}
\index{LOG\_WQUEUE\_LEN@{LOG\_WQUEUE\_LEN}!Osmocom logging internals@{Osmocom logging internals}}
\doxysubsubsection{LOG\_WQUEUE\_LEN}
{\footnotesize\ttfamily \#define LOG\+\_\+\+WQUEUE\+\_\+\+LEN~156}

\mbox{\label{group__logging__internal_gab6bc945ce840e4f0a16ec0fb12acc1a0}} 
\index{Osmocom logging internals@{Osmocom logging internals}!MAX\_LOG\_SIZE@{MAX\_LOG\_SIZE}}
\index{MAX\_LOG\_SIZE@{MAX\_LOG\_SIZE}!Osmocom logging internals@{Osmocom logging internals}}
\doxysubsubsection{MAX\_LOG\_SIZE}
{\footnotesize\ttfamily \#define MAX\+\_\+\+LOG\+\_\+\+SIZE~4096}



\doxysubsection{Function Documentation}
\mbox{\label{group__logging__internal_gae3277bfadd5b4e5bc609d85a1c53b5e0}} 
\index{Osmocom logging internals@{Osmocom logging internals}!assert\_loginfo@{assert\_loginfo}}
\index{assert\_loginfo@{assert\_loginfo}!Osmocom logging internals@{Osmocom logging internals}}
\doxysubsubsection{assert\_loginfo()}
{\footnotesize\ttfamily void assert\+\_\+loginfo (\begin{DoxyParamCaption}\item[{const char $\ast$}]{src }\end{DoxyParamCaption})}



References \textbf{ OSMO\+\_\+\+ASSERT}, and \textbf{ osmo\+\_\+log\+\_\+info}.



Referenced by \textbf{ log\+\_\+check\+\_\+level()}, \textbf{ log\+\_\+parse\+\_\+category()}, \textbf{ log\+\_\+parse\+\_\+category\+\_\+mask()}, and \textbf{ log\+\_\+target\+\_\+create()}.

\mbox{\label{group__logging__internal_gad0f490cca66aa8e7c414ece6a0dc6b5f}} 
\index{Osmocom logging internals@{Osmocom logging internals}!log\_output\_buf@{log\_output\_buf}}
\index{log\_output\_buf@{log\_output\_buf}!Osmocom logging internals@{Osmocom logging internals}}
\doxysubsubsection{log\_output\_buf()}
{\footnotesize\ttfamily int log\+\_\+output\+\_\+buf (\begin{DoxyParamCaption}\item[{char $\ast$}]{buf,  }\item[{int}]{buf\+\_\+len,  }\item[{struct \textbf{ log\+\_\+target} $\ast$}]{target,  }\item[{unsigned int}]{subsys,  }\item[{unsigned int}]{level,  }\item[{const char $\ast$}]{file,  }\item[{int}]{line,  }\item[{int}]{cont,  }\item[{const char $\ast$}]{format,  }\item[{va\+\_\+list}]{ap }\end{DoxyParamCaption})}



main output formatting function for log lines. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em buf} & caller-\/allocated output buffer for the generated string \\
\hline
\mbox{\texttt{ in}}  & {\em buf\+\_\+len} & number of bytes available in buf \\
\hline
\mbox{\texttt{ in}}  & {\em target} & log target for which the string is to be formatted \\
\hline
\mbox{\texttt{ in}}  & {\em subsys} & Log sub-\/system number \\
\hline
\mbox{\texttt{ in}}  & {\em level} & Log level \\
\hline
\mbox{\texttt{ in}}  & {\em file} & name of source code file generating the log \\
\hline
\mbox{\texttt{ in}}  & {\em line} & line source code line number within \textquotesingle{}file\textquotesingle{} generating the log \\
\hline
\mbox{\texttt{ in}}  & {\em cont} & is this a continuation (true) or not (false) \\
\hline
\mbox{\texttt{ in}}  & {\em format} & format string \\
\hline
\mbox{\texttt{ in}}  & {\em ap} & variable argument list for format \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes written to out 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+strbuf\+::buf}, \textbf{ color()}, \textbf{ const\+\_\+basename()}, \textbf{ file()}, \textbf{ level}, \textbf{ level\+\_\+color()}, \textbf{ log\+\_\+category\+\_\+name()}, \textbf{ LOG\+\_\+\+FILENAME\+\_\+\+BASENAME}, \textbf{ LOG\+\_\+\+FILENAME\+\_\+\+NONE}, \textbf{ LOG\+\_\+\+FILENAME\+\_\+\+PATH}, \textbf{ LOG\+\_\+\+FILENAME\+\_\+\+POS\+\_\+\+HEADER\+\_\+\+END}, \textbf{ LOG\+\_\+\+FILENAME\+\_\+\+POS\+\_\+\+LINE\+\_\+\+END}, \textbf{ log\+\_\+level\+\_\+str()}, \textbf{ osmo\+\_\+gettid()}, \textbf{ osmo\+\_\+gettimeofday()}, \textbf{ OSMO\+\_\+\+LOGCOLOR\+\_\+\+END}, \textbf{ OSMO\+\_\+\+STRBUF\+\_\+\+ADDED\+\_\+\+TAIL}, \textbf{ OSMO\+\_\+\+STRBUF\+\_\+\+APPEND}, \textbf{ OSMO\+\_\+\+STRBUF\+\_\+\+CHAR\+\_\+\+COUNT}, \textbf{ OSMO\+\_\+\+STRBUF\+\_\+\+DROP\+\_\+\+TAIL}, \textbf{ OSMO\+\_\+\+STRBUF\+\_\+\+PRINTF}, \textbf{ OSMO\+\_\+\+STRBUF\+\_\+\+REMAIN}, \textbf{ osmo\+\_\+strbuf\+::pos}, \textbf{ log\+\_\+target\+::print\+\_\+category}, \textbf{ log\+\_\+target\+::print\+\_\+category\+\_\+hex}, \textbf{ log\+\_\+target\+::print\+\_\+ext\+\_\+timestamp}, \textbf{ log\+\_\+target\+::print\+\_\+filename2}, \textbf{ log\+\_\+target\+::print\+\_\+filename\+\_\+pos}, \textbf{ log\+\_\+target\+::print\+\_\+level}, \textbf{ log\+\_\+target\+::print\+\_\+tid}, \textbf{ log\+\_\+target\+::print\+\_\+timestamp}, \textbf{ subsys}, \textbf{ log\+\_\+thread\+\_\+state\+::tid}, \textbf{ time}, and \textbf{ log\+\_\+target\+::use\+\_\+color}.



Referenced by \textbf{ \+\_\+file\+\_\+raw\+\_\+output()}, and \textbf{ osmo\+\_\+vlogp()}.

\mbox{\label{group__logging__internal_gae6561c1db02d391bc163096ed9e63444}} 
\index{Osmocom logging internals@{Osmocom logging internals}!log\_target\_file\_destroy@{log\_target\_file\_destroy}}
\index{log\_target\_file\_destroy@{log\_target\_file\_destroy}!Osmocom logging internals@{Osmocom logging internals}}
\doxysubsubsection{log\_target\_file\_destroy()}
{\footnotesize\ttfamily void log\+\_\+target\+\_\+file\+\_\+destroy (\begin{DoxyParamCaption}\item[{struct \textbf{ log\+\_\+target} $\ast$}]{target }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+wqueue\+::bfd}, \textbf{ osmo\+\_\+wqueue\+::except\+\_\+cb}, \textbf{ osmo\+\_\+fd\+::fd}, \textbf{ log\+\_\+target\+::fname}, \textbf{ LOG\+\_\+\+TGT\+\_\+\+TYPE\+\_\+\+FILE}, \textbf{ LOG\+\_\+\+TGT\+\_\+\+TYPE\+\_\+\+STDERR}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ osmo\+\_\+iofd\+\_\+free()}, \textbf{ log\+\_\+target\+::out}, \textbf{ log\+\_\+target\+::tgt\+\_\+file}, \textbf{ log\+\_\+target\+::type}, and \textbf{ log\+\_\+target\+::wqueue}.



Referenced by \textbf{ log\+\_\+target\+\_\+destroy()}.



\doxysubsection{Variable Documentation}
\mbox{\label{group__logging__internal_ga0ab25e0670db8f46e3bc1e1a4f68bf8a}} 
\index{Osmocom logging internals@{Osmocom logging internals}!log\_thread\_state@{log\_thread\_state}}
\index{log\_thread\_state@{log\_thread\_state}!Osmocom logging internals@{Osmocom logging internals}}
\doxysubsubsection{log\_thread\_state}
{\footnotesize\ttfamily \+\_\+\+\_\+thread struct \textbf{ log\+\_\+thread\+\_\+state} \textbf{ log\+\_\+thread\+\_\+state}\hspace{0.3cm}{\ttfamily [extern]}}

\mbox{\label{group__logging__internal_gaf6826ad1edc63df058816b245f336872}} 
\index{Osmocom logging internals@{Osmocom logging internals}!loglevel\_strs@{loglevel\_strs}}
\index{loglevel\_strs@{loglevel\_strs}!Osmocom logging internals@{Osmocom logging internals}}
\doxysubsubsection{loglevel\_strs}
{\footnotesize\ttfamily const struct \textbf{ value\+\_\+string} loglevel\+\_\+strs[$\,$]\hspace{0.3cm}{\ttfamily [extern]}}



Referenced by \textbf{ log\+\_\+level\+\_\+str()}, and \textbf{ log\+\_\+parse\+\_\+level()}.

\mbox{\label{group__logging__internal_ga81945895aa832524afb8edaa9eb366d8}} 
\index{Osmocom logging internals@{Osmocom logging internals}!osmo\_log\_info@{osmo\_log\_info}}
\index{osmo\_log\_info@{osmo\_log\_info}!Osmocom logging internals@{Osmocom logging internals}}
\doxysubsubsection{osmo\_log\_info}
{\footnotesize\ttfamily struct \textbf{ log\+\_\+info}$\ast$ osmo\+\_\+log\+\_\+info\hspace{0.3cm}{\ttfamily [extern]}}



Referenced by \textbf{ assert\+\_\+loginfo()}, \textbf{ color()}, \textbf{ log\+\_\+cache\+\_\+enable()}, \textbf{ log\+\_\+cache\+\_\+update\+\_\+all()}, \textbf{ log\+\_\+category\+\_\+name()}, \textbf{ log\+\_\+fini()}, \textbf{ log\+\_\+init()}, \textbf{ log\+\_\+parse\+\_\+category()}, \textbf{ log\+\_\+parse\+\_\+category\+\_\+mask()}, \textbf{ log\+\_\+target\+\_\+create()}, \textbf{ map\+\_\+subsys()}, \textbf{ should\+\_\+log\+\_\+to\+\_\+target()}, and \textbf{ subsys\+\_\+lib2index()}.

\mbox{\label{group__logging__internal_gab166ed54cb9f811c3ca616533a964082}} 
\index{Osmocom logging internals@{Osmocom logging internals}!osmo\_log\_target\_list@{osmo\_log\_target\_list}}
\index{osmo\_log\_target\_list@{osmo\_log\_target\_list}!Osmocom logging internals@{Osmocom logging internals}}
\doxysubsubsection{osmo\_log\_target\_list}
{\footnotesize\ttfamily struct \textbf{ llist\+\_\+head} osmo\+\_\+log\+\_\+target\+\_\+list\hspace{0.3cm}{\ttfamily [extern]}}



Referenced by \textbf{ log\+\_\+add\+\_\+target()}, \textbf{ log\+\_\+cache\+\_\+update()}, \textbf{ log\+\_\+cache\+\_\+update\+\_\+all()}, \textbf{ log\+\_\+check\+\_\+level()}, \textbf{ log\+\_\+fini()}, \textbf{ log\+\_\+target\+\_\+find()}, \textbf{ log\+\_\+targets\+\_\+reopen()}, and \textbf{ osmo\+\_\+vlogp()}.

\mbox{\label{group__logging__internal_ga637e5fb0ff764b323acb7caef1793dea}} 
\index{Osmocom logging internals@{Osmocom logging internals}!tall\_log\_ctx@{tall\_log\_ctx}}
\index{tall\_log\_ctx@{tall\_log\_ctx}!Osmocom logging internals@{Osmocom logging internals}}
\doxysubsubsection{tall\_log\_ctx}
{\footnotesize\ttfamily void$\ast$ tall\+\_\+log\+\_\+ctx\hspace{0.3cm}{\ttfamily [extern]}}



Referenced by \textbf{ log\+\_\+fini()}, \textbf{ log\+\_\+init()}, and \textbf{ log\+\_\+target\+\_\+create()}.

