LoggingMacros_SLOGGING_FMT.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
22 //----------------------------------------------------------------------
23 #ifndef ICL_CORE_LOGGING_LOGGING_MACROS__SLOGGING__FMT_H_INCLUDED
24 #define ICL_CORE_LOGGING_LOGGING_MACROS__SLOGGING__FMT_H_INCLUDED
25 
26 #define SLOGGING_FMT_LOG_FLCO(stream, level, filename, line, classname, objectname, ...) \
27  do { \
28  if (stream.isActive()) \
29  { \
30  if (stream.getLogLevel() <= level) \
31  { \
32  ::icl_core::logging::ThreadStream& thread_stream = stream.threadStream(level); \
33  thread_stream.setLineLogLevel(level); \
34  thread_stream.setFilename(filename); \
35  thread_stream.setLine(line); \
36  thread_stream.setClassname(classname); \
37  thread_stream.setObjectname(objectname); \
38  thread_stream.setFunction(__FUNCTION__); \
39  thread_stream.printf(__VA_ARGS__); \
40  } \
41  } \
42  } while (0)
43 #define SLOGGING_FMT_LOG_CO(stream, level, classname, objectname, ...) SLOGGING_FMT_LOG_FLCO(stream, level, __FILE__, __LINE__, #classname, objectname, __VA_ARGS__)
44 #define SLOGGING_FMT_LOG_C(stream, level, classname, ...) SLOGGING_FMT_LOG_FLCO(stream, level, __FILE__, __LINE__, #classname, "", __VA_ARGS__)
45 #define SLOGGING_FMT_LOG(stream, level, ...) SLOGGING_FMT_LOG_FLCO(stream, level, __FILE__, __LINE__, "", "", __VA_ARGS__)
46 
47 
48 #define SLOGGING_FMT_ERROR(stream, ...) SLOGGING_FMT_LOG(stream, ::icl_core::logging::eLL_ERROR, __VA_ARGS__)
49 #define SLOGGING_FMT_WARNING(stream, ...) SLOGGING_FMT_LOG(stream, ::icl_core::logging::eLL_WARNING, __VA_ARGS__)
50 #define SLOGGING_FMT_INFO(stream, ...) SLOGGING_FMT_LOG(stream, ::icl_core::logging::eLL_INFO, __VA_ARGS__)
51 #ifdef _IC_DEBUG_
52 # define SLOGGING_FMT_DEBUG(stream, ...) SLOGGING_FMT_LOG(stream, ::icl_core::logging::eLL_DEBUG, __VA_ARGS__)
53 # define SLOGGING_FMT_TRACE(stream, ...) SLOGGING_FMT_LOG(stream, ::icl_core::logging::eLL_TRACE, __VA_ARGS__)
54 #else
55 # define SLOGGING_FMT_DEBUG(stream, ...) (void)0
56 # define SLOGGING_FMT_TRACE(stream, ...) (void)0
57 #endif
58 
59 
60 #define SLOGGING_FMT_ERROR_C(stream, classname, ...) SLOGGING_FMT_LOG_C(stream, ::icl_core::logging::eLL_ERROR, classname, __VA_ARGS__)
61 #define SLOGGING_FMT_WARNING_C(stream, classname, ...) SLOGGING_FMT_LOG_C(stream, ::icl_core::logging::eLL_WARNING, classname, __VA_ARGS__)
62 #define SLOGGING_FMT_INFO_C(stream, classname, ...) SLOGGING_FMT_LOG_C(stream, ::icl_core::logging::eLL_INFO, classname, __VA_ARGS__)
63 #ifdef _IC_DEBUG_
64 # define SLOGGING_FMT_DEBUG_C(stream, classname, ...) SLOGGING_FMT_LOG_C(stream, ::icl_core::logging::eLL_DEBUG, classname, __VA_ARGS__)
65 # define SLOGGING_FMT_TRACE_C(stream, classname, ...) SLOGGING_FMT_LOG_C(stream, ::icl_core::logging::eLL_TRACE, classname, __VA_ARGS__)
66 #else
67 # define SLOGGING_FMT_DEBUG_C(stream, classname, ...) (void)0
68 # define SLOGGING_FMT_TRACE_C(stream, classname, ...) (void)0
69 #endif
70 
71 
72 #define SLOGGING_FMT_ERROR_CO(stream, classname, objectname, ...) SLOGGING_FMT_LOG_CO(stream, ::icl_core::logging::eLL_ERROR, classname, objectname, __VA_ARGS__)
73 #define SLOGGING_FMT_WARNING_CO(stream, classname, objectname, ...) SLOGGING_FMT_LOG_CO(stream, ::icl_core::logging::eLL_WARNING, classname, objectname, __VA_ARGS__)
74 #define SLOGGING_FMT_INFO_CO(stream, classname, objectname, ...) SLOGGING_FMT_LOG_CO(stream, ::icl_core::logging::eLL_INFO, classname, objectname, __VA_ARGS__)
75 #ifdef _IC_DEBUG_
76 # define SLOGGING_FMT_DEBUG_CO(stream, classname, objectname, ...) SLOGGING_FMT_LOG_CO(stream, ::icl_core::logging::eLL_DEBUG, classname, objectname, __VA_ARGS__)
77 # define SLOGGING_FMT_TRACE_CO(stream, classname, objectname, ...) SLOGGING_FMT_LOG_CO(stream, ::icl_core::logging::eLL_TRACE, classname, objectname, __VA_ARGS__)
78 #else
79 # define SLOGGING_FMT_DEBUG_CO(stream, classname, objectname, ...) (void)0
80 # define SLOGGING_FMT_TRACE_CO(stream, classname, objectname, ...) (void)0
81 #endif
82 
83 #endif


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58