\hypertarget{lirc__log_8h}{}\section{/home/mk/tmp/lirc/lib/lirc\+\_\+log.h File Reference}
\label{lirc__log_8h}\index{/home/mk/tmp/lirc/lib/lirc\+\_\+log.\+h(dad0c0a 2015-\/02-\/09 13\+:36\+:06 +0100)@{/home/mk/tmp/lirc/lib/lirc\+\_\+log.\+h(dad0c0a 2015-\/02-\/09 13\+:36\+:06 +0100)}}


Logging functionality.  


{\ttfamily \#include $<$syslog.\+h$>$}\\*
{\ttfamily \#include $<$sys/time.\+h$>$}\\*
{\ttfamily \#include $<$stdio.\+h$>$}\\*
{\ttfamily \#include $<$unistd.\+h$>$}\\*
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{lirc__log_8h_aab936871da54fbececcc7afaa58eba05}{L\+I\+R\+C\+\_\+\+M\+A\+X\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}~L\+I\+R\+C\+\_\+\+T\+R\+A\+C\+E2
\item 
\#define \hyperlink{lirc__log_8h_a73d2617e7f322ed6323c901a825f3605}{L\+I\+R\+C\+\_\+\+M\+I\+N\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}~L\+I\+R\+C\+\_\+\+E\+R\+R\+O\+R
\item 
\#define \hyperlink{lirc__log_8h_aec8c265923c6714be1f4a42e252bc872}{D\+E\+F\+A\+U\+L\+T\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}~L\+I\+R\+C\+\_\+\+I\+N\+F\+O
\item 
\#define \hyperlink{lirc__log_8h_aaba0fdc653c790307b8857e38cf1322c}{logmax}(l)~(l $>$ L\+I\+R\+C\+\_\+\+D\+E\+B\+U\+G ? L\+I\+R\+C\+\_\+\+D\+E\+B\+U\+G \+: l)
\item 
\#define \hyperlink{lirc__log_8h_acbcca4fd1b04b4035ad81e658073949f}{L\+O\+G\+P\+R\+I\+N\+T\+F}(level,  fmt,  args...)
\item 
\#define \hyperlink{lirc__log_8h_a83cdcceb9104338b111b3fa3da4b5d5f}{L\+O\+G\+P\+E\+R\+R\+O\+R}(level,  s)
\item 
\#define \hyperlink{lirc__log_8h_a67dd394e852230678863cb4139e5ccfd}{lirc\+\_\+log\+\_\+is\+\_\+enabled\+\_\+for}(level)~(level $<$= \hyperlink{lirc__log_8h_a1c0866a106e32b72cfa74e9d352b255d}{loglevel})
\item 
\#define \hyperlink{lirc__log_8h_a6df1d22fb5f09eccc23b9f399670cfd7}{S\+T\+R\+I\+N\+G\+I\+F\+Y}(x)~\#x
\item 
\#define \hyperlink{lirc__log_8h_a18d295a837ac71add5578860b55e5502}{S\+T\+R}(x)~\hyperlink{lirc__log_8h_a6df1d22fb5f09eccc23b9f399670cfd7}{S\+T\+R\+I\+N\+G\+I\+F\+Y}(x)
\item 
\#define \hyperlink{lirc__log_8h_aa373c8d82f30ed0a8bf6d5234b335eb9}{chk\+\_\+write}(fd,  buf,  count)~do\+\_\+chk\+\_\+write(fd, buf, count, \hyperlink{lirc__log_8h_a18d295a837ac71add5578860b55e5502}{S\+T\+R}(\+\_\+\+\_\+\+F\+I\+L\+E\+\_\+\+\_\+) \char`\"{}\+:\char`\"{} \hyperlink{lirc__log_8h_a18d295a837ac71add5578860b55e5502}{S\+T\+R}(\+\_\+\+\_\+\+L\+I\+N\+E\+\_\+\+\_\+))
\item 
\#define \hyperlink{lirc__log_8h_a251f1e577259210952afaf7ddb406c71}{chk\+\_\+read}(fd,  buf,  count)~do\+\_\+chk\+\_\+read(fd, buf, count, \hyperlink{lirc__log_8h_a18d295a837ac71add5578860b55e5502}{S\+T\+R}(\+\_\+\+\_\+\+F\+I\+L\+E\+\_\+\+\_\+) \char`\"{}\+:\char`\"{} \hyperlink{lirc__log_8h_a18d295a837ac71add5578860b55e5502}{S\+T\+R}(\+\_\+\+\_\+\+L\+I\+N\+E\+\_\+\+\_\+))
\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{lirc__log_8h_a24e101a095456e946efea0b971fc2ee3}{loglevel\+\_\+t} \{ \\*
{\bfseries L\+I\+R\+C\+\_\+\+T\+R\+A\+C\+E2} = 10, 
{\bfseries L\+I\+R\+C\+\_\+\+T\+R\+A\+C\+E1} = 9, 
{\bfseries L\+I\+R\+C\+\_\+\+T\+R\+A\+C\+E} = 8, 
{\bfseries L\+I\+R\+C\+\_\+\+D\+E\+B\+U\+G} = L\+O\+G\+\_\+\+D\+E\+B\+U\+G, 
\\*
{\bfseries L\+I\+R\+C\+\_\+\+I\+N\+F\+O} = L\+O\+G\+\_\+\+I\+N\+F\+O, 
{\bfseries L\+I\+R\+C\+\_\+\+N\+O\+T\+I\+C\+E} = L\+O\+G\+\_\+\+N\+O\+T\+I\+C\+E, 
{\bfseries L\+I\+R\+C\+\_\+\+W\+A\+R\+N\+I\+N\+G} = L\+O\+G\+\_\+\+W\+A\+R\+N\+I\+N\+G, 
{\bfseries L\+I\+R\+C\+\_\+\+E\+R\+R\+O\+R} = L\+O\+G\+\_\+\+E\+R\+R, 
\\*
{\bfseries L\+I\+R\+C\+\_\+\+N\+O\+L\+O\+G} = 0, 
{\bfseries L\+I\+R\+C\+\_\+\+B\+A\+D\+L\+E\+V\+E\+L} = -\/1
 \}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{lirc__log_8h_a24e101a095456e946efea0b971fc2ee3}{loglevel\+\_\+t} \hyperlink{lirc__log_8h_a97d698fa0c9f913ba9b16c5b30af6f76}{string2loglevel} (const char $\ast$level)
\item 
int \hyperlink{lirc__log_8h_a43d290e2c8b30ac1f72accfc0a22b9ba}{lirc\+\_\+log\+\_\+setlevel} (\hyperlink{lirc__log_8h_a24e101a095456e946efea0b971fc2ee3}{loglevel\+\_\+t} level)
\item 
\hyperlink{lirc__log_8h_a24e101a095456e946efea0b971fc2ee3}{loglevel\+\_\+t} \hyperlink{lirc__log_8h_ad9ecabbf33ad978a5dc9a265c3b16365}{lirc\+\_\+log\+\_\+defaultlevel} (void)
\item 
int \hyperlink{lirc__log_8h_a283ad387ae5bec5223df6d6a7589d2cb}{lirc\+\_\+log\+\_\+use\+\_\+syslog} (void)
\item 
void \hyperlink{lirc__log_8h_a29b67f5d1afc944a5c4487711d0f93b3}{logprintf} (\hyperlink{lirc__log_8h_a24e101a095456e946efea0b971fc2ee3}{loglevel\+\_\+t} prio, const char $\ast$format\+\_\+str,...)
\item 
void \hyperlink{lirc__log_8h_ac68851f11aeac30180f524fc8dde4fab}{logperror} (\hyperlink{lirc__log_8h_a24e101a095456e946efea0b971fc2ee3}{loglevel\+\_\+t} prio, const char $\ast$format,...)
\item 
\hypertarget{lirc__log_8h_af96aebf4f1b1b729d1b32ff2f00903ee}{}int {\bfseries lirc\+\_\+log\+\_\+reopen} (void)\label{lirc__log_8h_af96aebf4f1b1b729d1b32ff2f00903ee}

\item 
int \hyperlink{lirc__log_8h_ab9796198d8a199d20171fd6dcc46f215}{lirc\+\_\+log\+\_\+open} (const char $\ast$progname, int \+\_\+nodaemon, \hyperlink{lirc__log_8h_a24e101a095456e946efea0b971fc2ee3}{loglevel\+\_\+t} level)
\item 
int \hyperlink{lirc__log_8h_ac4cddc1f18ff055b1be8755c46d830bb}{lirc\+\_\+log\+\_\+close} (void)
\item 
void \hyperlink{lirc__log_8h_a2eaf417e2b2dd63861d17b2c836fe1b8}{lirc\+\_\+log\+\_\+set\+\_\+file} (const char $\ast$s)
\item 
int \hyperlink{lirc__log_8h_a5af3dc8e52fabe122ac7ec52c6852885}{lirc\+\_\+log\+\_\+get\+\_\+clientlog} (const char $\ast$basename, char $\ast$buffer, ssize\+\_\+t size)
\item 
void \hyperlink{lirc__log_8h_a30ad875dc57527c9a0037df67bab420f}{hexdump} (char $\ast$prefix, unsigned char $\ast$buf, int len)
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\hyperlink{lirc__log_8h_a24e101a095456e946efea0b971fc2ee3}{loglevel\+\_\+t} \hyperlink{lirc__log_8h_a1c0866a106e32b72cfa74e9d352b255d}{loglevel}
\item 
\hypertarget{lirc__log_8h_a2b2397fb25253f9de2014ac16c7fcf15}{}char {\bfseries progname} \mbox{[}128\mbox{]}\label{lirc__log_8h_a2b2397fb25253f9de2014ac16c7fcf15}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Logging functionality. 



\subsection{Macro Definition Documentation}
\hypertarget{lirc__log_8h_a251f1e577259210952afaf7ddb406c71}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!chk\+\_\+read@{chk\+\_\+read}}
\index{chk\+\_\+read@{chk\+\_\+read}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{chk\+\_\+read}]{\setlength{\rightskip}{0pt plus 5cm}\#define chk\+\_\+read(
\begin{DoxyParamCaption}
\item[{}]{fd, }
\item[{}]{buf, }
\item[{}]{count}
\end{DoxyParamCaption}
)~do\+\_\+chk\+\_\+read(fd, buf, count, {\bf S\+T\+R}(\+\_\+\+\_\+\+F\+I\+L\+E\+\_\+\+\_\+) \char`\"{}\+:\char`\"{} {\bf S\+T\+R}(\+\_\+\+\_\+\+L\+I\+N\+E\+\_\+\+\_\+))}\label{lirc__log_8h_a251f1e577259210952afaf7ddb406c71}
Wrapper for read(2) which logs errors. 

Definition at line 164 of file lirc\+\_\+log.\+h.

\hypertarget{lirc__log_8h_aa373c8d82f30ed0a8bf6d5234b335eb9}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!chk\+\_\+write@{chk\+\_\+write}}
\index{chk\+\_\+write@{chk\+\_\+write}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{chk\+\_\+write}]{\setlength{\rightskip}{0pt plus 5cm}\#define chk\+\_\+write(
\begin{DoxyParamCaption}
\item[{}]{fd, }
\item[{}]{buf, }
\item[{}]{count}
\end{DoxyParamCaption}
)~do\+\_\+chk\+\_\+write(fd, buf, count, {\bf S\+T\+R}(\+\_\+\+\_\+\+F\+I\+L\+E\+\_\+\+\_\+) \char`\"{}\+:\char`\"{} {\bf S\+T\+R}(\+\_\+\+\_\+\+L\+I\+N\+E\+\_\+\+\_\+))}\label{lirc__log_8h_aa373c8d82f30ed0a8bf6d5234b335eb9}
Wrapper for write(2) which logs errors. 

Definition at line 159 of file lirc\+\_\+log.\+h.

\hypertarget{lirc__log_8h_aec8c265923c6714be1f4a42e252bc872}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!D\+E\+F\+A\+U\+L\+T\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L@{D\+E\+F\+A\+U\+L\+T\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}}
\index{D\+E\+F\+A\+U\+L\+T\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L@{D\+E\+F\+A\+U\+L\+T\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{D\+E\+F\+A\+U\+L\+T\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}]{\setlength{\rightskip}{0pt plus 5cm}\#define D\+E\+F\+A\+U\+L\+T\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L~L\+I\+R\+C\+\_\+\+I\+N\+F\+O}\label{lirc__log_8h_aec8c265923c6714be1f4a42e252bc872}
Default loglevel (last resort). 

Definition at line 62 of file lirc\+\_\+log.\+h.

\hypertarget{lirc__log_8h_a67dd394e852230678863cb4139e5ccfd}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!lirc\+\_\+log\+\_\+is\+\_\+enabled\+\_\+for@{lirc\+\_\+log\+\_\+is\+\_\+enabled\+\_\+for}}
\index{lirc\+\_\+log\+\_\+is\+\_\+enabled\+\_\+for@{lirc\+\_\+log\+\_\+is\+\_\+enabled\+\_\+for}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{lirc\+\_\+log\+\_\+is\+\_\+enabled\+\_\+for}]{\setlength{\rightskip}{0pt plus 5cm}\#define lirc\+\_\+log\+\_\+is\+\_\+enabled\+\_\+for(
\begin{DoxyParamCaption}
\item[{}]{level}
\end{DoxyParamCaption}
)~(level $<$= {\bf loglevel})}\label{lirc__log_8h_a67dd394e852230678863cb4139e5ccfd}
Check if a given, standard loglevel should be printed. 

Definition at line 102 of file lirc\+\_\+log.\+h.

\hypertarget{lirc__log_8h_aab936871da54fbececcc7afaa58eba05}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!L\+I\+R\+C\+\_\+\+M\+A\+X\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L@{L\+I\+R\+C\+\_\+\+M\+A\+X\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}}
\index{L\+I\+R\+C\+\_\+\+M\+A\+X\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L@{L\+I\+R\+C\+\_\+\+M\+A\+X\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{L\+I\+R\+C\+\_\+\+M\+A\+X\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}]{\setlength{\rightskip}{0pt plus 5cm}\#define L\+I\+R\+C\+\_\+\+M\+A\+X\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L~L\+I\+R\+C\+\_\+\+T\+R\+A\+C\+E2}\label{lirc__log_8h_aab936871da54fbececcc7afaa58eba05}
Max loglevel (for validation). 

Definition at line 50 of file lirc\+\_\+log.\+h.

\hypertarget{lirc__log_8h_a73d2617e7f322ed6323c901a825f3605}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!L\+I\+R\+C\+\_\+\+M\+I\+N\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L@{L\+I\+R\+C\+\_\+\+M\+I\+N\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}}
\index{L\+I\+R\+C\+\_\+\+M\+I\+N\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L@{L\+I\+R\+C\+\_\+\+M\+I\+N\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{L\+I\+R\+C\+\_\+\+M\+I\+N\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L}]{\setlength{\rightskip}{0pt plus 5cm}\#define L\+I\+R\+C\+\_\+\+M\+I\+N\+\_\+\+L\+O\+G\+L\+E\+V\+E\+L~L\+I\+R\+C\+\_\+\+E\+R\+R\+O\+R}\label{lirc__log_8h_a73d2617e7f322ed6323c901a825f3605}
Mix loglevel (for validation). 

Definition at line 53 of file lirc\+\_\+log.\+h.

\hypertarget{lirc__log_8h_aaba0fdc653c790307b8857e38cf1322c}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!logmax@{logmax}}
\index{logmax@{logmax}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{logmax}]{\setlength{\rightskip}{0pt plus 5cm}\#define logmax(
\begin{DoxyParamCaption}
\item[{}]{l}
\end{DoxyParamCaption}
)~(l $>$ L\+I\+R\+C\+\_\+\+D\+E\+B\+U\+G ? L\+I\+R\+C\+\_\+\+D\+E\+B\+U\+G \+: l)}\label{lirc__log_8h_aaba0fdc653c790307b8857e38cf1322c}
Max level logged in actual logfile. 

Definition at line 68 of file lirc\+\_\+log.\+h.

\hypertarget{lirc__log_8h_a83cdcceb9104338b111b3fa3da4b5d5f}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!L\+O\+G\+P\+E\+R\+R\+O\+R@{L\+O\+G\+P\+E\+R\+R\+O\+R}}
\index{L\+O\+G\+P\+E\+R\+R\+O\+R@{L\+O\+G\+P\+E\+R\+R\+O\+R}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{L\+O\+G\+P\+E\+R\+R\+O\+R}]{\setlength{\rightskip}{0pt plus 5cm}\#define L\+O\+G\+P\+E\+R\+R\+O\+R(
\begin{DoxyParamCaption}
\item[{}]{level, }
\item[{}]{s}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_a83cdcceb9104338b111b3fa3da4b5d5f}
{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordflow}{if} (level + 7 <= \hyperlink{lirc__log_8h_a1c0866a106e32b72cfa74e9d352b255d}{loglevel}) \hyperlink{lirc__log_8h_ac68851f11aeac30180f524fc8dde4fab}{\(\backslash\)}
\hyperlink{lirc__log_8h_ac68851f11aeac30180f524fc8dde4fab}{                logperror}(\hyperlink{lirc__log_8h_aaba0fdc653c790307b8857e38cf1322c}{logmax}(level + 7), s)
\end{DoxyCode}
Compatibility perror(3) wrapper Accepts level 1..3 which are mapped to L\+I\+R\+C\+\_\+\+T\+R\+A\+C\+E..L\+I\+R\+C\+\_\+\+T\+R\+A\+C\+E2. 

Definition at line 83 of file lirc\+\_\+log.\+h.

\hypertarget{lirc__log_8h_acbcca4fd1b04b4035ad81e658073949f}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!L\+O\+G\+P\+R\+I\+N\+T\+F@{L\+O\+G\+P\+R\+I\+N\+T\+F}}
\index{L\+O\+G\+P\+R\+I\+N\+T\+F@{L\+O\+G\+P\+R\+I\+N\+T\+F}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{L\+O\+G\+P\+R\+I\+N\+T\+F}]{\setlength{\rightskip}{0pt plus 5cm}\#define L\+O\+G\+P\+R\+I\+N\+T\+F(
\begin{DoxyParamCaption}
\item[{}]{level, }
\item[{}]{fmt, }
\item[{}]{args...}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_acbcca4fd1b04b4035ad81e658073949f}
{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordflow}{if} (level + 7 <= \hyperlink{lirc__log_8h_a1c0866a106e32b72cfa74e9d352b255d}{loglevel}) \hyperlink{lirc__log_8h_a29b67f5d1afc944a5c4487711d0f93b3}{\(\backslash\)}
\hyperlink{lirc__log_8h_a29b67f5d1afc944a5c4487711d0f93b3}{                logprintf}(\hyperlink{lirc__log_8h_aaba0fdc653c790307b8857e38cf1322c}{logmax}(level + 7), fmt, ## args)
\end{DoxyCode}
Compatibility log message stuff.. Accepts level 1..3 which are mapped to L\+I\+R\+C\+\_\+\+T\+R\+A\+C\+E..L\+I\+R\+C\+\_\+\+T\+R\+A\+C\+E2. 

Definition at line 75 of file lirc\+\_\+log.\+h.

\hypertarget{lirc__log_8h_a18d295a837ac71add5578860b55e5502}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!S\+T\+R@{S\+T\+R}}
\index{S\+T\+R@{S\+T\+R}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{S\+T\+R}]{\setlength{\rightskip}{0pt plus 5cm}\#define S\+T\+R(
\begin{DoxyParamCaption}
\item[{}]{x}
\end{DoxyParamCaption}
)~{\bf S\+T\+R\+I\+N\+G\+I\+F\+Y}(x)}\label{lirc__log_8h_a18d295a837ac71add5578860b55e5502}
Return x in (double) quotes. 

Definition at line 156 of file lirc\+\_\+log.\+h.

\hypertarget{lirc__log_8h_a6df1d22fb5f09eccc23b9f399670cfd7}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!S\+T\+R\+I\+N\+G\+I\+F\+Y@{S\+T\+R\+I\+N\+G\+I\+F\+Y}}
\index{S\+T\+R\+I\+N\+G\+I\+F\+Y@{S\+T\+R\+I\+N\+G\+I\+F\+Y}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{S\+T\+R\+I\+N\+G\+I\+F\+Y}]{\setlength{\rightskip}{0pt plus 5cm}\#define S\+T\+R\+I\+N\+G\+I\+F\+Y(
\begin{DoxyParamCaption}
\item[{}]{x}
\end{DoxyParamCaption}
)~\#x}\label{lirc__log_8h_a6df1d22fb5f09eccc23b9f399670cfd7}
Helper macro for \hyperlink{lirc__log_8h_a18d295a837ac71add5578860b55e5502}{S\+T\+R()}. 

Definition at line 153 of file lirc\+\_\+log.\+h.



\subsection{Enumeration Type Documentation}
\hypertarget{lirc__log_8h_a24e101a095456e946efea0b971fc2ee3}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!loglevel\+\_\+t@{loglevel\+\_\+t}}
\index{loglevel\+\_\+t@{loglevel\+\_\+t}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{loglevel\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf loglevel\+\_\+t}}\label{lirc__log_8h_a24e101a095456e946efea0b971fc2ee3}
The defined loglevels. L\+I\+R\+C\+\_\+\+T\+R\+A\+C\+E..L\+I\+R\+C\+\_\+\+T\+R\+A\+C\+E2 is mapped to L\+I\+R\+C\+\_\+\+D\+E\+B\+U\+G in outputted messages, but generates more messages than D\+E\+B\+U\+G. 

Definition at line 36 of file lirc\+\_\+log.\+h.



\subsection{Function Documentation}
\hypertarget{lirc__log_8h_a30ad875dc57527c9a0037df67bab420f}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!hexdump@{hexdump}}
\index{hexdump@{hexdump}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{hexdump}]{\setlength{\rightskip}{0pt plus 5cm}void hexdump (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{prefix, }
\item[{unsigned char $\ast$}]{buf, }
\item[{int}]{len}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_a30ad875dc57527c9a0037df67bab420f}
Print prefix + a hex dump of len bytes starting at $\ast$buf. 

Definition at line 348 of file lirc\+\_\+log.\+c.

\hypertarget{lirc__log_8h_ac4cddc1f18ff055b1be8755c46d830bb}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!lirc\+\_\+log\+\_\+close@{lirc\+\_\+log\+\_\+close}}
\index{lirc\+\_\+log\+\_\+close@{lirc\+\_\+log\+\_\+close}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{lirc\+\_\+log\+\_\+close}]{\setlength{\rightskip}{0pt plus 5cm}int lirc\+\_\+log\+\_\+close (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_ac4cddc1f18ff055b1be8755c46d830bb}
Close the log previosly opened with \hyperlink{lirc__log_8h_ab9796198d8a199d20171fd6dcc46f215}{lirc\+\_\+log\+\_\+open()}. 

Definition at line 120 of file lirc\+\_\+log.\+c.

\hypertarget{lirc__log_8h_ad9ecabbf33ad978a5dc9a265c3b16365}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!lirc\+\_\+log\+\_\+defaultlevel@{lirc\+\_\+log\+\_\+defaultlevel}}
\index{lirc\+\_\+log\+\_\+defaultlevel@{lirc\+\_\+log\+\_\+defaultlevel}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{lirc\+\_\+log\+\_\+defaultlevel}]{\setlength{\rightskip}{0pt plus 5cm}{\bf loglevel\+\_\+t} lirc\+\_\+log\+\_\+defaultlevel (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_ad9ecabbf33ad978a5dc9a265c3b16365}
Get the default level, from environment or hardcoded. 

Definition at line 202 of file lirc\+\_\+log.\+c.

\hypertarget{lirc__log_8h_a5af3dc8e52fabe122ac7ec52c6852885}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!lirc\+\_\+log\+\_\+get\+\_\+clientlog@{lirc\+\_\+log\+\_\+get\+\_\+clientlog}}
\index{lirc\+\_\+log\+\_\+get\+\_\+clientlog@{lirc\+\_\+log\+\_\+get\+\_\+clientlog}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{lirc\+\_\+log\+\_\+get\+\_\+clientlog}]{\setlength{\rightskip}{0pt plus 5cm}int lirc\+\_\+log\+\_\+get\+\_\+clientlog (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{basename, }
\item[{char $\ast$}]{buffer, }
\item[{ssize\+\_\+t}]{size}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_a5af3dc8e52fabe122ac7ec52c6852885}
Retrieve a client path for logging according to freedesktop specs.


\begin{DoxyParams}{Parameters}
{\em basename} & Basename for the logfile. \\
\hline
{\em buff} & Buffer to store result in. \\
\hline
{\em size} & Size of buffer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if O\+K, otherwise -\/1 
\end{DoxyReturn}


Definition at line 311 of file lirc\+\_\+log.\+c.

\hypertarget{lirc__log_8h_ab9796198d8a199d20171fd6dcc46f215}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!lirc\+\_\+log\+\_\+open@{lirc\+\_\+log\+\_\+open}}
\index{lirc\+\_\+log\+\_\+open@{lirc\+\_\+log\+\_\+open}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{lirc\+\_\+log\+\_\+open}]{\setlength{\rightskip}{0pt plus 5cm}int lirc\+\_\+log\+\_\+open (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{progname, }
\item[{int}]{\+\_\+nodaemon, }
\item[{{\bf loglevel\+\_\+t}}]{level}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_ab9796198d8a199d20171fd6dcc46f215}
Open the log for upcoming logging


\begin{DoxyParams}{Parameters}
{\em progname} & Name of application, made available in global progname \\
\hline
{\em nodaemon} & If true, program runs in foreground and logging is on also on stdout. \\
\hline
{\em level} & The lowest level of messages to actually be logged. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if O\+K, else positive error code. 
\end{DoxyReturn}


Definition at line 86 of file lirc\+\_\+log.\+c.

\hypertarget{lirc__log_8h_a2eaf417e2b2dd63861d17b2c836fe1b8}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!lirc\+\_\+log\+\_\+set\+\_\+file@{lirc\+\_\+log\+\_\+set\+\_\+file}}
\index{lirc\+\_\+log\+\_\+set\+\_\+file@{lirc\+\_\+log\+\_\+set\+\_\+file}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{lirc\+\_\+log\+\_\+set\+\_\+file}]{\setlength{\rightskip}{0pt plus 5cm}void lirc\+\_\+log\+\_\+set\+\_\+file (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{s}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_a2eaf417e2b2dd63861d17b2c836fe1b8}
Set logfile. Either a regular path or the string \textquotesingle{}syslog\textquotesingle{}; the latter does indeed use syslog(1) instead. Must be called before \hyperlink{lirc__log_8h_ab9796198d8a199d20171fd6dcc46f215}{lirc\+\_\+log\+\_\+open()}. 

Definition at line 75 of file lirc\+\_\+log.\+c.

\hypertarget{lirc__log_8h_a43d290e2c8b30ac1f72accfc0a22b9ba}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!lirc\+\_\+log\+\_\+setlevel@{lirc\+\_\+log\+\_\+setlevel}}
\index{lirc\+\_\+log\+\_\+setlevel@{lirc\+\_\+log\+\_\+setlevel}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{lirc\+\_\+log\+\_\+setlevel}]{\setlength{\rightskip}{0pt plus 5cm}int lirc\+\_\+log\+\_\+setlevel (
\begin{DoxyParamCaption}
\item[{{\bf loglevel\+\_\+t}}]{level}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_a43d290e2c8b30ac1f72accfc0a22b9ba}
Set the level. Returns 1 if ok, 0 on errors. 

Definition at line 162 of file lirc\+\_\+log.\+c.

\hypertarget{lirc__log_8h_a283ad387ae5bec5223df6d6a7589d2cb}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!lirc\+\_\+log\+\_\+use\+\_\+syslog@{lirc\+\_\+log\+\_\+use\+\_\+syslog}}
\index{lirc\+\_\+log\+\_\+use\+\_\+syslog@{lirc\+\_\+log\+\_\+use\+\_\+syslog}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{lirc\+\_\+log\+\_\+use\+\_\+syslog}]{\setlength{\rightskip}{0pt plus 5cm}int lirc\+\_\+log\+\_\+use\+\_\+syslog (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_a283ad387ae5bec5223df6d6a7589d2cb}
Check if log is set up to use syslog or not. 

Definition at line 69 of file lirc\+\_\+log.\+c.

\hypertarget{lirc__log_8h_ac68851f11aeac30180f524fc8dde4fab}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!logperror@{logperror}}
\index{logperror@{logperror}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{logperror}]{\setlength{\rightskip}{0pt plus 5cm}void logperror (
\begin{DoxyParamCaption}
\item[{{\bf loglevel\+\_\+t}}]{prio, }
\item[{const char $\ast$}]{fmt, }
\item[{}]{...}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_ac68851f11aeac30180f524fc8dde4fab}
Log current kernel error with a given level.

Prints a description of the last error to the log. 
\begin{DoxyParams}{Parameters}
{\em prio} & Priority of log request. \\
\hline
{\em fmt} & printf-\/style format string \\
\hline
\end{DoxyParams}


Definition at line 289 of file lirc\+\_\+log.\+c.

\hypertarget{lirc__log_8h_a29b67f5d1afc944a5c4487711d0f93b3}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!logprintf@{logprintf}}
\index{logprintf@{logprintf}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{logprintf}]{\setlength{\rightskip}{0pt plus 5cm}void logprintf (
\begin{DoxyParamCaption}
\item[{{\bf loglevel\+\_\+t}}]{prio, }
\item[{const char $\ast$}]{format\+\_\+str, }
\item[{}]{...}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_a29b67f5d1afc944a5c4487711d0f93b3}
Write a message to log.


\begin{DoxyParams}{Parameters}
{\em prio} & Level of message \\
\hline
{\em format\+\_\+str,...} & printf-\/style string.\\
\hline
\end{DoxyParams}
Prints the log request to the log, if the priority fits. 
\begin{DoxyParams}{Parameters}
{\em prio} & Priority of log request \\
\hline
{\em format\+\_\+str} & Format string in the usual C sense. \\
\hline
{\em ...} & Additional vararg parameters. \\
\hline
\end{DoxyParams}


Definition at line 243 of file lirc\+\_\+log.\+c.

\hypertarget{lirc__log_8h_a97d698fa0c9f913ba9b16c5b30af6f76}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!string2loglevel@{string2loglevel}}
\index{string2loglevel@{string2loglevel}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{string2loglevel}]{\setlength{\rightskip}{0pt plus 5cm}{\bf loglevel\+\_\+t} string2loglevel (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{level}
\end{DoxyParamCaption}
)}\label{lirc__log_8h_a97d698fa0c9f913ba9b16c5b30af6f76}
Convert a string, either a number or \textquotesingle{}info\textquotesingle{}, \textquotesingle{}trace1\textquotesingle{}, error etc. to a loglevel. 

Definition at line 217 of file lirc\+\_\+log.\+c.



\subsection{Variable Documentation}
\hypertarget{lirc__log_8h_a1c0866a106e32b72cfa74e9d352b255d}{}\index{lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}!loglevel@{loglevel}}
\index{loglevel@{loglevel}!lirc\+\_\+log.\+h@{lirc\+\_\+log.\+h}}
\subsubsection[{loglevel}]{\setlength{\rightskip}{0pt plus 5cm}{\bf loglevel\+\_\+t} loglevel}\label{lirc__log_8h_a1c0866a106e32b72cfa74e9d352b255d}
The actual loglevel. Should not be changed directly by external code. 

Definition at line 40 of file lirc\+\_\+log.\+c.

