Skip to content

Commit a9f2444

Browse files
authored
Merge pull request #70 from sy-c/master
v2.0.1
2 parents 1fee78d + d79c43a commit a9f2444

File tree

6 files changed

+32
-4
lines changed

6 files changed

+32
-4
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ target_link_libraries(
275275
)
276276

277277

278-
# executable: infoLoggerAdminDB
278+
# executable: o2-infologger-admindb
279279
add_executable(
280280
o2-infologger-admindb
281281
$<TARGET_OBJECTS:objCommonConfiguration>
@@ -420,7 +420,8 @@ target_link_libraries(
420420
# exclude modules requiring optional dependencies not found
421421
if(NOT MYSQL_FOUND)
422422
message("MySQL not found, some infoLogger modules are disabled for this build")
423-
set_target_properties(infoLoggerAdminDB PROPERTIES EXCLUDE_FROM_ALL 1)
423+
set_target_properties(o2-infologger-admindb PROPERTIES EXCLUDE_FROM_ALL 1)
424+
set_target_properties(o2-infologger-test-db PROPERTIES EXCLUDE_FROM_ALL 1)
424425
endif()
425426

426427

doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ The InfoLogger library allows to inject messages directly from programs, as show
182182
183183
* When using the C++ API, it is recommended to use the macros defined in InfoLoggerMacros.hxx to have the full context defined (severity, level, errno, source file/line) for each message in a compact way.
184184
185-
* Some example calls are available in [the source code](/test/testInfoLogger.cxx)
185+
* Some example calls are available in the source code: [1](/example/exampleLog.cxx) [2](/test/testInfoLogger.cxx)
186186
187187
* There is the possibility to easily redirect FairLogger messages (see InfoLoggerFMQ.hxx) and process stdout/stderr to infologger (see InfoLogger.hxx setStandardRedirection())
188188
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,

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,6 @@ This file describes the main feature changes for each InfoLogger released versio
9191
## v2.0.0 - 06/04/2021
9292
- doxygen doc cleanup
9393
- Adapted to follow o2-flp conventions: renaming of executables, libraries, services, paths.
94+
95+
## v2.0.1 - 05/05/2021
96+
- fix reconnect timeout in stdout fallback mode (now 5s).

example/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# typical command:
33
# cmake -DInfoLogger_DIR=path/to/infologger/lib/cmake/InfoLogger ..
44

5+
project (InfoLoggerExample)
6+
cmake_minimum_required(VERSION 3.17)
7+
58
find_package(InfoLogger REQUIRED)
69
set(CMAKE_CXX_STANDARD 14)
710
add_executable(exampleLog exampleLog.cxx)

example/exampleLog.cxx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,32 @@
99
// or submit itself to any jurisdiction.
1010

1111
#include <InfoLogger/InfoLogger.hxx>
12+
13+
// optionnaly, use the helper macros
14+
#include <InfoLogger/InfoLoggerMacros.hxx>
15+
1216
using namespace AliceO2::InfoLogger;
1317
int main()
1418
{
19+
// create handle to infologger system
1520
InfoLogger theLog;
1621

22+
// or, alternatively, to start infologger library in debug mode on stdout
23+
// (can also be done at runtime by setting environment O2_INFOLOGGER_MODE)
24+
// outputMode can be one of stdout, debug, infoLoggerD, ...
25+
// InfoLogger theLog("outputMode=debug");
26+
27+
// optionnaly, customize some of the "static" fields
28+
// to be applied to all messages
29+
InfoLoggerContext theLogContext;
30+
theLogContext.setField(InfoLoggerContext::FieldName::Facility, "myTestFacility");
31+
theLog.setContext(theLogContext);
32+
33+
// log a message
1734
theLog.log("infoLogger message test");
35+
36+
// log a warning with code 1234 for developers
37+
theLog.log(LogWarningDevel_(1234), "this is a test warning message");
38+
1839
return 0;
1940
}

src/InfoLoggerClient.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void InfoLoggerClient::reconnect() {
283283
} else {
284284
if (isVerbose) log.info("reconnect failed");
285285
}
286-
reconnectTimer.reset(cfg.reconnectTimeout);
286+
reconnectTimer.reset(cfg.reconnectTimeout*1000000.0);
287287
}
288288
}
289289
usleep(200000);

0 commit comments

Comments
 (0)