\doxysection{src/core/logging\+\_\+file.c File Reference}
\label{logging__file_8c}\index{src/core/logging\_file.c@{src/core/logging\_file.c}}


File \& stderr logging support code.  


{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\newline
{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$fcntl.\+h$>$}\newline
{\ttfamily \#include $<$stdarg.\+h$>$}\newline
{\ttfamily \#include $<$stdbool.\+h$>$}\newline
{\ttfamily \#include $<$stdlib.\+h$>$}\newline
{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$unistd.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/talloc.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/select.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/write\+\_\+queue.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/osmo\+\_\+io.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/logging\+\_\+internal.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \textbf{ log\+\_\+target\+\_\+file\+\_\+reopen} (struct \textbf{ log\+\_\+target} $\ast$target)
\begin{DoxyCompactList}\small\item\em close and re-\/open a log file (for log file rotation) \end{DoxyCompactList}\item 
int \textbf{ log\+\_\+target\+\_\+file\+\_\+set\+\_\+nonblock} (struct \textbf{ log\+\_\+target} $\ast$target, int on)
\begin{DoxyCompactList}\small\item\em Set the log target fd as non-\/blocking (see sockopt O\+\_\+\+NONBLOCK). \end{DoxyCompactList}\item 
int \textbf{ log\+\_\+target\+\_\+file\+\_\+get\+\_\+nonblock} (const struct \textbf{ log\+\_\+target} $\ast$target)
\begin{DoxyCompactList}\small\item\em Find whether the log target fd is configured as non-\/blocking (see sockopt O\+\_\+\+NONBLOCK). \end{DoxyCompactList}\item 
void \textbf{ log\+\_\+target\+\_\+file\+\_\+destroy} (struct \textbf{ log\+\_\+target} $\ast$target)
\item 
static void \textbf{ \+\_\+file\+\_\+output\+\_\+stream} (struct \textbf{ log\+\_\+target} $\ast$target, unsigned int \textbf{ level}, const char $\ast$log)
\item 
static void \textbf{ \+\_\+file\+\_\+raw\+\_\+output} (struct \textbf{ log\+\_\+target} $\ast$target, int \textbf{ subsys}, unsigned int \textbf{ level}, const char $\ast$\textbf{ file}, int line, int cont, const char $\ast$format, va\+\_\+list ap)
\item 
void \textbf{ \+\_\+log\+\_\+target\+\_\+file\+\_\+setup\+\_\+talloc\+\_\+pool} (struct \textbf{ log\+\_\+target} $\ast$target)
\item 
int \textbf{ log\+\_\+target\+\_\+file\+\_\+switch\+\_\+to\+\_\+stream} (struct \textbf{ log\+\_\+target} $\ast$target)
\begin{DoxyCompactList}\small\item\em switch from non-\/blocking/write-\/queue to blocking + buffered stream output \end{DoxyCompactList}\item 
int \textbf{ \+\_\+log\+\_\+target\+\_\+file\+\_\+setup\+\_\+iofd} (struct \textbf{ log\+\_\+target} $\ast$target, int fd)
\item 
int \textbf{ log\+\_\+target\+\_\+file\+\_\+switch\+\_\+to\+\_\+wqueue} (struct \textbf{ log\+\_\+target} $\ast$target)
\begin{DoxyCompactList}\small\item\em switch from blocking + buffered file output to non-\/blocking write-\/queue based output. \end{DoxyCompactList}\item 
struct \textbf{ log\+\_\+target} $\ast$ \textbf{ log\+\_\+target\+\_\+create\+\_\+file} (const char $\ast$fname)
\begin{DoxyCompactList}\small\item\em Create a new file-\/based log target using a stream. \end{DoxyCompactList}\item 
struct \textbf{ log\+\_\+target} $\ast$ \textbf{ log\+\_\+target\+\_\+create\+\_\+stderr} (void)
\begin{DoxyCompactList}\small\item\em Create the STDERR log target. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static struct \textbf{ osmo\+\_\+io\+\_\+ops} \textbf{ log\+\_\+target\+\_\+file\+\_\+io\+\_\+ops}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
File \& stderr logging support code. 

