log_8h_source.tex 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. \hypertarget{log_8h_source}{}\doxysection{log.\+h}
  2. \label{log_8h_source}\index{include/toolbox/log.h@{include/toolbox/log.h}}
  3. \begin{DoxyCode}{0}
  4. \DoxyCodeLine{1 \textcolor{preprocessor}{\#ifndef TOOLBOX\_LOG\_H}}
  5. \DoxyCodeLine{2 \textcolor{preprocessor}{\#define TOOLBOX\_LOG\_H}}
  6. \DoxyCodeLine{3 }
  7. \DoxyCodeLine{4 \textcolor{preprocessor}{\#include "{}toolbox/ansi\_escape.h"{}}}
  8. \DoxyCodeLine{5 }
  9. \DoxyCodeLine{6 \textcolor{preprocessor}{\#include <stdio.h>}}
  10. \DoxyCodeLine{7 }
  11. \DoxyCodeLine{8 \textcolor{preprocessor}{\#ifndef LOG\_FILE\_OUT}}
  12. \DoxyCodeLine{9 \textcolor{preprocessor}{\#define LOG\_FILE\_OUT stdout}}
  13. \DoxyCodeLine{10 \textcolor{preprocessor}{\#endif}}
  14. \DoxyCodeLine{11 }
  15. \DoxyCodeLine{12 \textcolor{preprocessor}{\#define LOGV\_TEST(MSG, ...) \(\backslash\)}}
  16. \DoxyCodeLine{13 \textcolor{preprocessor}{ fprintf(LOG\_FILE\_OUT \(\backslash\)}}
  17. \DoxyCodeLine{14 \textcolor{preprocessor}{ , FG\_MAGENTA"{}"{}}SET\_BLINK"{}[TEST] (\%s:\%d) "{}MSG"{}"{}RST\_ALL"{}\(\backslash\)n"{} \(\backslash\)}
  18. \DoxyCodeLine{15 , \_\_FILE\_NAME\_\_, \_\_LINE\_\_, \_\_VA\_ARGS\_\_)}
  19. \DoxyCodeLine{16 \textcolor{preprocessor}{\#define LOGV\_INFO(MSG, ...) \(\backslash\)}}
  20. \DoxyCodeLine{17 \textcolor{preprocessor}{ fprintf(LOG\_FILE\_OUT, "{}[INFO] (\%s:\%d) "{}}MSG"{}"{}RST\_ALL"{}\(\backslash\)n"{} \(\backslash\)}
  21. \DoxyCodeLine{18 , \_\_FILE\_NAME\_\_, \_\_LINE\_\_, \_\_VA\_ARGS\_\_)}
  22. \DoxyCodeLine{19 \textcolor{preprocessor}{\#define LOGV\_WARNING(MSG, ...) \(\backslash\)}}
  23. \DoxyCodeLine{20 \textcolor{preprocessor}{ fprintf(LOG\_FILE\_OUT, FG\_YELLOW"{}[WARNING] (\%s:\%d) "{}}MSG"{}"{}RST\_ALL"{}\(\backslash\)n"{} \(\backslash\)}
  24. \DoxyCodeLine{21 , \_\_FILE\_NAME\_\_, \_\_LINE\_\_, \_\_VA\_ARGS\_\_)}
  25. \DoxyCodeLine{22 \textcolor{preprocessor}{\#define LOGV\_ERROR(MSG, ...) \(\backslash\)}}
  26. \DoxyCodeLine{23 \textcolor{preprocessor}{ fprintf(LOG\_FILE\_OUT, FG\_RED"{}[ERROR] (\%s:\%d) "{}}MSG"{}"{}RST\_ALL"{}\(\backslash\)n"{} \(\backslash\)}
  27. \DoxyCodeLine{24 , \_\_FILE\_NAME\_\_, \_\_LINE\_\_, \_\_VA\_ARGS\_\_)}
  28. \DoxyCodeLine{25 }
  29. \DoxyCodeLine{26 \textcolor{preprocessor}{\#define LOG\_TEST(MSG) \(\backslash\)}}
  30. \DoxyCodeLine{27 \textcolor{preprocessor}{ fprintf(LOG\_FILE\_OUT \(\backslash\)}}
  31. \DoxyCodeLine{28 \textcolor{preprocessor}{ , FG\_MAGENTA"{}"{}}SET\_BLINK"{}[TEST] (\%s:\%d) "{}MSG"{}"{}RST\_ALL"{}\(\backslash\)n"{} \(\backslash\)}
  32. \DoxyCodeLine{29 , \_\_FILE\_NAME\_\_, \_\_LINE\_\_)}
  33. \DoxyCodeLine{30 \textcolor{preprocessor}{\#define LOG\_INFO(MSG) \(\backslash\)}}
  34. \DoxyCodeLine{31 \textcolor{preprocessor}{ fprintf(LOG\_FILE\_OUT, "{}[INFO] (\%s:\%d) "{}}MSG"{}"{}RST\_ALL"{}\(\backslash\)n"{} \(\backslash\)}
  35. \DoxyCodeLine{32 , \_\_FILE\_NAME\_\_, \_\_LINE\_\_)}
  36. \DoxyCodeLine{33 \textcolor{preprocessor}{\#define LOG\_WARNING(MSG) \(\backslash\)}}
  37. \DoxyCodeLine{34 \textcolor{preprocessor}{ fprintf(LOG\_FILE\_OUT, FG\_YELLOW"{}[WARNING] (\%s:\%d) "{}}MSG"{}"{}RST\_ALL"{}\(\backslash\)n"{} \(\backslash\)}
  38. \DoxyCodeLine{35 , \_\_FILE\_NAME\_\_, \_\_LINE\_\_)}
  39. \DoxyCodeLine{36 \textcolor{preprocessor}{\#define LOG\_ERROR(MSG) \(\backslash\)}}
  40. \DoxyCodeLine{37 \textcolor{preprocessor}{ fprintf(LOG\_FILE\_OUT, FG\_RED"{}[ERROR] (\%s:\%d) "{}}MSG"{}"{}RST\_ALL"{}\(\backslash\)n"{} \(\backslash\)}
  41. \DoxyCodeLine{38 , \_\_FILE\_NAME\_\_, \_\_LINE\_\_)}
  42. \DoxyCodeLine{39 }
  43. \DoxyCodeLine{40 \textcolor{preprocessor}{\#endif}}
  44. \end{DoxyCode}