75
75
#define CONSOLE_BRIDGE_logDebug (...) \
76
76
console_bridge::log (__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_DEBUG, __VA_ARGS__)
77
77
78
-
79
- /* * \brief Message namespace. This contains classes needed to
80
- output error messages (or logging) from within the library.
81
- Message logging can be performed with \ref logging "logging macros" */
78
+ /* *
79
+ * \brief Message namespace. This contains classes needed to output error messages (or logging)
80
+ * from within the library. Message logging can be performed with \ref logging "logging macros"
81
+ */
82
82
namespace console_bridge
83
83
{
84
84
/* * \brief The set of priorities for message logging */
@@ -91,37 +91,37 @@ enum CONSOLE_BRIDGE_DLLAPI LogLevel
91
91
CONSOLE_BRIDGE_LOG_NONE
92
92
};
93
93
94
- /* * \brief Generic class to handle output from a piece of
95
- code.
96
-
97
- In order to handle output from the library in different
98
- ways, an implementation of this class needs to be
99
- provided. This instance can be set with the useOutputHandler
100
- function. */
94
+ /* *
95
+ * \brief Generic class to handle output from a piece of code.
96
+ *
97
+ * In order to handle output from the library in different ways, an implementation of this class
98
+ * needs to be provided. This instance can be set with the useOutputHandler function.
99
+ */
101
100
class CONSOLE_BRIDGE_DLLAPI OutputHandler
102
101
{
103
102
public:
104
- OutputHandler (void )
105
- {
106
- }
107
-
108
- virtual ~OutputHandler (void )
109
- {
110
- }
111
-
112
- /* * \brief log a message to the output handler with the given text
113
- and logging level from a specific file and line number */
103
+ OutputHandler (void ){}
104
+
105
+ virtual ~OutputHandler (void ){}
106
+
107
+ /* *
108
+ * \brief log a message to the output handler with the given text and logging level from a
109
+ * specific file and line number
110
+ * \param text to log
111
+ * \param level console_bridge log level
112
+ * \param filename of the output log
113
+ * \param line
114
+ */
114
115
virtual void log (const std::string &text, LogLevel level, const char *filename, int line) = 0;
115
116
};
116
117
117
- /* * \brief Default implementation of OutputHandler. This sends
118
- the information to the console. */
118
+ /* *
119
+ * \brief Default implementation of OutputHandler. This sends the information to the console.
120
+ */
119
121
class CONSOLE_BRIDGE_DLLAPI OutputHandlerSTD : public OutputHandler
120
122
{
121
123
public:
122
- OutputHandlerSTD (void ) : OutputHandler()
123
- {
124
- }
124
+ OutputHandlerSTD (void ) : OutputHandler(){}
125
125
126
126
virtual void log (const std::string &text, LogLevel level, const char *filename, int line);
127
127
};
@@ -142,41 +142,51 @@ class CONSOLE_BRIDGE_DLLAPI OutputHandlerFile : public OutputHandler
142
142
FILE *file_;
143
143
};
144
144
145
- /* * \brief This function instructs ompl that no messages should be outputted.
145
+ /* *
146
+ * \brief This function instructs console bridge that no messages should be outputted.
146
147
* Equivalent to useOutputHandler(NULL)
147
148
*/
148
149
CONSOLE_BRIDGE_DLLAPI void noOutputHandler (void );
149
150
150
- /* * \brief Restore the output handler that was previously in use (if any) */
151
+ /* *
152
+ * \brief Restore the output handler that was previously in use (if any)
153
+ */
151
154
CONSOLE_BRIDGE_DLLAPI void restorePreviousOutputHandler (void );
152
155
153
- /* * \brief Specify the instance of the OutputHandler to use.
156
+ /* *
157
+ * \brief Specify the instance of the OutputHandler to use.
154
158
* By default, this is OutputHandlerSTD
155
159
*/
156
160
CONSOLE_BRIDGE_DLLAPI void useOutputHandler (OutputHandler *oh);
157
161
158
- /* * \brief Get the instance of the OutputHandler currently used.
162
+ /* *
163
+ * \brief Get the instance of the OutputHandler currently used.
159
164
* This is NULL in case there is no output handler.
160
165
*/
161
166
CONSOLE_BRIDGE_DLLAPI OutputHandler* getOutputHandler (void );
162
167
163
- /* * \brief Set the minimum level of logging data to output. Messages
164
- with lower logging levels will not be recorded. */
168
+ /* *
169
+ * \brief Set the minimum level of logging data to output. Messages with lower logging levels will
170
+ * not be recorded.
171
+ */
165
172
CONSOLE_BRIDGE_DLLAPI void setLogLevel (LogLevel level);
166
173
167
- /* * \brief Retrieve the current level of logging data. Messages
168
- with lower logging levels will not be recorded. */
174
+ /* *
175
+ * \brief Retrieve the current level of logging data. Messages with lower logging levels will not be
176
+ * recorded.
177
+ */
169
178
CONSOLE_BRIDGE_DLLAPI LogLevel getLogLevel (void );
170
179
171
- /* * \brief Root level logging function. This should not be invoked directly,
172
- but rather used via a \ref logging "logging macro". Formats the message
173
- string given the arguments and forwards the string to the output handler */
180
+ /* *
181
+ * \brief Root level logging function. This should not be invoked directly, but rather used via a
182
+ * \ref logging "logging macro". Formats the message string given the arguments and forwards the
183
+ * string to the output handler
184
+ */
174
185
CONSOLE_BRIDGE_DLLAPI void log (const char *file,
175
186
int line,
176
187
LogLevel level,
177
188
const char * m,
178
189
...);
179
190
} // namespace console_bridge
180
191
181
-
182
192
#endif // INCLUDE_CONSOLE_BRIDGE_CONSOLE_H_
0 commit comments