\hypertarget{nnstreamer__log_8c}{}\doxysection{nnstreamer/nnstreamer\+\_\+log.c File Reference}
\label{nnstreamer__log_8c}\index{nnstreamer/nnstreamer\_log.c@{nnstreamer/nnstreamer\_log.c}}


Internal log and error handling for N\+N\+Streamer plugins and core codes.  


{\ttfamily \#include $<$execinfo.\+h$>$}\newline
{\ttfamily \#include $<$stdlib.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$glib.\+h$>$}\newline
{\ttfamily \#include \char`\"{}nnstreamer\+\_\+log.\+h\char`\"{}}\newline
Include dependency graph for nnstreamer\+\_\+log.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{nnstreamer__log_8c__incl}
\end{center}
\end{figure}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{nnstreamer__log_8c_aec2d04c57ce3283f57280f62c1b27262}{\+\_\+\+N\+N\+S\+T\+R\+E\+A\+M\+E\+R\+\_\+\+E\+R\+R\+O\+R\+\_\+\+L\+E\+N\+G\+TH}}~(4096U)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
char $\ast$ \mbox{\hyperlink{nnstreamer__log_8c_aeaa0fd539d84ff6526d90b3df739ee42}{\+\_\+backtrace\+\_\+to\+\_\+string}} (void)
\begin{DoxyCompactList}\small\item\em stack trace as a string for error messages \end{DoxyCompactList}\item 
\mbox{\hyperlink{nnstreamer__log_8c_adb280f0e114c2698af78607c8f18cd93}{G\+\_\+\+L\+O\+C\+K\+\_\+\+D\+E\+F\+I\+N\+E\+\_\+\+S\+T\+A\+T\+IC}} (errlock)
\item 
const char $\ast$ \mbox{\hyperlink{nnstreamer__log_8c_aa3fd50b115e9f497139aa63f6aa2c31d}{\+\_\+nnstreamer\+\_\+error}} (void)
\begin{DoxyCompactList}\small\item\em return the last internal error string and clean it. \end{DoxyCompactList}\item 
\mbox{\hyperlink{nnstreamer__log_8c_af318467849b211d46c7004808594cbd8}{\+\_\+\+\_\+attribute\+\_\+\+\_\+}} ((\+\_\+\+\_\+format\+\_\+\+\_\+(\+\_\+\+\_\+printf\+\_\+\+\_\+, 1, 2)))
\begin{DoxyCompactList}\small\item\em overwrites the error message buffer with the new message. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{nnstreamer__log_8c_af97e69f48057cb69556f3fcd1999e3f6}{\+\_\+nnstreamer\+\_\+error\+\_\+clean}} (void)
\begin{DoxyCompactList}\small\item\em cleans up the error message buffer. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static char \mbox{\hyperlink{nnstreamer__log_8c_a499b0d969959fc7bac1704ab95117e4b}{errmsg}} \mbox{[}\mbox{\hyperlink{nnstreamer__log_8c_aec2d04c57ce3283f57280f62c1b27262}{\+\_\+\+N\+N\+S\+T\+R\+E\+A\+M\+E\+R\+\_\+\+E\+R\+R\+O\+R\+\_\+\+L\+E\+N\+G\+TH}}\mbox{]} = \{ 0 \}
\item 
static int \mbox{\hyperlink{nnstreamer__log_8c_a2b3054eafb9c2ee4a0e92abe67cdf76c}{errmsg\+\_\+reported}} = 0
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Internal log and error handling for N\+N\+Streamer plugins and core codes. 

\begin{DoxyDate}{Date}
31 Mar 2022 
\end{DoxyDate}
\begin{DoxySeeAlso}{See also}
\href{http://github.com/nnstreamer/nnstreamer}{\texttt{ http\+://github.\+com/nnstreamer/nnstreamer}} 
\end{DoxySeeAlso}
\begin{DoxyAuthor}{Author}
Myung\+Joo Ham \href{mailto:myungjoo.ham@samsung.com}{\texttt{ myungjoo.\+ham@samsung.\+com}} 
\end{DoxyAuthor}
\begin{DoxyRefDesc}{Bug}
\item[\mbox{\hyperlink{bug__bug000090}{Bug}}]No known bugs except for N\+YI items \end{DoxyRefDesc}


\doxysubsection{Macro Definition Documentation}
\mbox{\Hypertarget{nnstreamer__log_8c_aec2d04c57ce3283f57280f62c1b27262}\label{nnstreamer__log_8c_aec2d04c57ce3283f57280f62c1b27262}} 
\index{nnstreamer\_log.c@{nnstreamer\_log.c}!\_NNSTREAMER\_ERROR\_LENGTH@{\_NNSTREAMER\_ERROR\_LENGTH}}
\index{\_NNSTREAMER\_ERROR\_LENGTH@{\_NNSTREAMER\_ERROR\_LENGTH}!nnstreamer\_log.c@{nnstreamer\_log.c}}
\doxysubsubsection{\texorpdfstring{\_NNSTREAMER\_ERROR\_LENGTH}{\_NNSTREAMER\_ERROR\_LENGTH}}
{\footnotesize\ttfamily \#define \+\_\+\+N\+N\+S\+T\+R\+E\+A\+M\+E\+R\+\_\+\+E\+R\+R\+O\+R\+\_\+\+L\+E\+N\+G\+TH~(4096U)}



Definition at line 70 of file nnstreamer\+\_\+log.\+c.



\doxysubsection{Function Documentation}
\mbox{\Hypertarget{nnstreamer__log_8c_af318467849b211d46c7004808594cbd8}\label{nnstreamer__log_8c_af318467849b211d46c7004808594cbd8}} 
\index{nnstreamer\_log.c@{nnstreamer\_log.c}!\_\_attribute\_\_@{\_\_attribute\_\_}}
\index{\_\_attribute\_\_@{\_\_attribute\_\_}!nnstreamer\_log.c@{nnstreamer\_log.c}}
\doxysubsubsection{\texorpdfstring{\_\_attribute\_\_()}{\_\_attribute\_\_()}}
{\footnotesize\ttfamily \+\_\+\+\_\+attribute\+\_\+\+\_\+ (\begin{DoxyParamCaption}\item[{(\+\_\+\+\_\+format\+\_\+\+\_\+(\+\_\+\+\_\+printf\+\_\+\+\_\+, 1, 2))}]{ }\end{DoxyParamCaption})}



overwrites the error message buffer with the new message. 

The attribute is for clang workaround in macos\+: \href{https://stackoverflow.com/questions/20167124/vsprintf-and-vsnprintf-wformat-nonliteral-warning-on-clang-5-0}{\texttt{ https\+://stackoverflow.\+com/questions/20167124/vsprintf-\/and-\/vsnprintf-\/wformat-\/nonliteral-\/warning-\/on-\/clang-\/5-\/0}}

Definition at line 97 of file nnstreamer\+\_\+log.\+c.

\mbox{\Hypertarget{nnstreamer__log_8c_aeaa0fd539d84ff6526d90b3df739ee42}\label{nnstreamer__log_8c_aeaa0fd539d84ff6526d90b3df739ee42}} 
\index{nnstreamer\_log.c@{nnstreamer\_log.c}!\_backtrace\_to\_string@{\_backtrace\_to\_string}}
\index{\_backtrace\_to\_string@{\_backtrace\_to\_string}!nnstreamer\_log.c@{nnstreamer\_log.c}}
\doxysubsubsection{\texorpdfstring{\_backtrace\_to\_string()}{\_backtrace\_to\_string()}}
{\footnotesize\ttfamily char$\ast$ \+\_\+backtrace\+\_\+to\+\_\+string (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



stack trace as a string for error messages 

\begin{DoxyReturn}{Returns}
a string of stacktrace result. caller should free it. 
\end{DoxyReturn}
\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000049}{Todo}}]The .c file location of this function might be not appropriate. \end{DoxyRefDesc}


Definition at line 35 of file nnstreamer\+\_\+log.\+c.

\mbox{\Hypertarget{nnstreamer__log_8c_aa3fd50b115e9f497139aa63f6aa2c31d}\label{nnstreamer__log_8c_aa3fd50b115e9f497139aa63f6aa2c31d}} 
\index{nnstreamer\_log.c@{nnstreamer\_log.c}!\_nnstreamer\_error@{\_nnstreamer\_error}}
\index{\_nnstreamer\_error@{\_nnstreamer\_error}!nnstreamer\_log.c@{nnstreamer\_log.c}}
\doxysubsubsection{\texorpdfstring{\_nnstreamer\_error()}{\_nnstreamer\_error()}}
{\footnotesize\ttfamily const char$\ast$ \+\_\+nnstreamer\+\_\+error (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



return the last internal error string and clean it. 

\begin{DoxyReturn}{Returns}
a string of error. Do not free the returned string. 
\end{DoxyReturn}


Definition at line 81 of file nnstreamer\+\_\+log.\+c.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{nnstreamer__log_8c_aa3fd50b115e9f497139aa63f6aa2c31d_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{nnstreamer__log_8c_af97e69f48057cb69556f3fcd1999e3f6}\label{nnstreamer__log_8c_af97e69f48057cb69556f3fcd1999e3f6}} 
\index{nnstreamer\_log.c@{nnstreamer\_log.c}!\_nnstreamer\_error\_clean@{\_nnstreamer\_error\_clean}}
\index{\_nnstreamer\_error\_clean@{\_nnstreamer\_error\_clean}!nnstreamer\_log.c@{nnstreamer\_log.c}}
\doxysubsubsection{\texorpdfstring{\_nnstreamer\_error\_clean()}{\_nnstreamer\_error\_clean()}}
{\footnotesize\ttfamily void \+\_\+nnstreamer\+\_\+error\+\_\+clean (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



cleans up the error message buffer. 



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

\mbox{\Hypertarget{nnstreamer__log_8c_adb280f0e114c2698af78607c8f18cd93}\label{nnstreamer__log_8c_adb280f0e114c2698af78607c8f18cd93}} 
\index{nnstreamer\_log.c@{nnstreamer\_log.c}!G\_LOCK\_DEFINE\_STATIC@{G\_LOCK\_DEFINE\_STATIC}}
\index{G\_LOCK\_DEFINE\_STATIC@{G\_LOCK\_DEFINE\_STATIC}!nnstreamer\_log.c@{nnstreamer\_log.c}}
\doxysubsubsection{\texorpdfstring{G\_LOCK\_DEFINE\_STATIC()}{G\_LOCK\_DEFINE\_STATIC()}}
{\footnotesize\ttfamily G\+\_\+\+L\+O\+C\+K\+\_\+\+D\+E\+F\+I\+N\+E\+\_\+\+S\+T\+A\+T\+IC (\begin{DoxyParamCaption}\item[{errlock}]{ }\end{DoxyParamCaption})}



\doxysubsection{Variable Documentation}
\mbox{\Hypertarget{nnstreamer__log_8c_a499b0d969959fc7bac1704ab95117e4b}\label{nnstreamer__log_8c_a499b0d969959fc7bac1704ab95117e4b}} 
\index{nnstreamer\_log.c@{nnstreamer\_log.c}!errmsg@{errmsg}}
\index{errmsg@{errmsg}!nnstreamer\_log.c@{nnstreamer\_log.c}}
\doxysubsubsection{\texorpdfstring{errmsg}{errmsg}}
{\footnotesize\ttfamily char errmsg\mbox{[}\mbox{\hyperlink{nnstreamer__log_8c_aec2d04c57ce3283f57280f62c1b27262}{\+\_\+\+N\+N\+S\+T\+R\+E\+A\+M\+E\+R\+\_\+\+E\+R\+R\+O\+R\+\_\+\+L\+E\+N\+G\+TH}}\mbox{]} = \{ 0 \}\hspace{0.3cm}{\ttfamily [static]}}



Definition at line 71 of file nnstreamer\+\_\+log.\+c.

\mbox{\Hypertarget{nnstreamer__log_8c_a2b3054eafb9c2ee4a0e92abe67cdf76c}\label{nnstreamer__log_8c_a2b3054eafb9c2ee4a0e92abe67cdf76c}} 
\index{nnstreamer\_log.c@{nnstreamer\_log.c}!errmsg\_reported@{errmsg\_reported}}
\index{errmsg\_reported@{errmsg\_reported}!nnstreamer\_log.c@{nnstreamer\_log.c}}
\doxysubsubsection{\texorpdfstring{errmsg\_reported}{errmsg\_reported}}
{\footnotesize\ttfamily int errmsg\+\_\+reported = 0\hspace{0.3cm}{\ttfamily [static]}}



Definition at line 73 of file nnstreamer\+\_\+log.\+c.

