You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -178,6 +178,10 @@ The InfoLogger library allows to inject messages directly from programs, as show
178
178
179
179
* Some example calls are available in [the source code](/test/testInfoLogger.cxx)
180
180
181
+
* There is the possibility to easily redirect FairLogger messages (see InfoLoggerFMQ.hxx) and process stdout/stderr to infologger (see InfoLogger.hxx setStandardRedirection())
182
+
without changing the code from where they are issued. Although practical to get all output in InfoLogger, the messages captured this way are injected with a reduced number of tags,
183
+
so it is recommended to use the native InfoLogger API to inject messages whenever possible.
184
+
181
185
* The tags associated to a message consist of the following fields (which may be left undefined):
182
186
* Severity: the kind of message, one of: Info (default), Error, Fatal, Warning, Debug
183
187
* Level: the relative visibility of the message and associated target audience to whom is addressed the message: from 1 (important, visible to all) to 99 (low-level debug message, for experts only).
Copy file name to clipboardExpand all lines: include/InfoLogger/InfoLogger.hxx
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -196,6 +196,12 @@ class InfoLogger
196
196
// all context fields will be set to default unless an explicit context argument is given for each message.
197
197
intunsetContext();
198
198
199
+
/// Turn on/off stdout/stderr redirection
200
+
/// true -> turn ON. Stdout/Stderr are redirected to internal pipes and a dedicated thread captures the stream and redirects to this instance of infologger (with corresponding severity).
201
+
/// false -> turn OFF (if it was ON). Stdout/Stderr are redirected to previous outputs, and capture thread is stopped.
202
+
/// Return 0 on success, or an error code otherwise
203
+
intsetStandardRedirection(bool state);
204
+
199
205
// todo: common handling of error codes in O2?
200
206
// 0-9999: "shared" -> can be reused accross modules
201
207
// 99.9999: 2-digit 'error namespace' + local error id
0 commit comments