forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DPL: optimise signposts implementation
Move out of line the implementation for the Logger case.
- Loading branch information
Showing
5 changed files
with
151 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
#define O2_SIGNPOST_IMPLEMENTATION | ||
#include "Framework/Signpost.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
|
||
#ifdef __APPLE__ | ||
#define O2_SIGNPOST_IMPLEMENTATION | ||
#endif | ||
#define O2_FORCE_LOGGER_SIGNPOST 1 | ||
#include "Framework/Signpost.h" | ||
#include <iostream> | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
O2_DECLARE_LOG(test_Signpost, "my category"); | ||
O2_DECLARE_DYNAMIC_LOG(test_SignpostDynamic); | ||
|
||
O2_LOG_DEBUG(test_Signpost, "%s %d", "test_Signpost", 1); | ||
O2_SIGNPOST_ID_GENERATE(id, test_Signpost); | ||
O2_SIGNPOST_ID_GENERATE(id2, test_Signpost); | ||
O2_SIGNPOST_START(test_Signpost, id, "Test category", "This is a test signpost"); | ||
O2_SIGNPOST_START(test_Signpost, id2, "Test category", "A sepaarate interval"); | ||
O2_SIGNPOST_EVENT_EMIT(test_Signpost, id, "Test category", "An event in an interval"); | ||
O2_SIGNPOST_END(test_Signpost, id, "Test category", "End of the first interval"); | ||
O2_SIGNPOST_END(test_Signpost, id2, "Test category", "A sepaarate interval"); | ||
O2_SIGNPOST_ID_FROM_POINTER(id3, test_Signpost, &id2); | ||
O2_SIGNPOST_START(test_Signpost, id3, "Test category", "A signpost interval from a pointer"); | ||
O2_SIGNPOST_END(test_Signpost, id3, "Test category", "A signpost interval from a pointer"); | ||
|
||
// This has an engineering type, which we will not use on Linux / FairLogger | ||
O2_SIGNPOST_ID_FROM_POINTER(id4, test_Signpost, &id3); | ||
O2_SIGNPOST_START(test_Signpost, id4, "Test category", "A signpost with an engineering type formatter " O2_ENG_TYPE(size - in - bytes, "d"), 1); | ||
O2_SIGNPOST_END(test_Signpost, id4, "Test category", "A signpost interval from a pointer"); | ||
|
||
O2_SIGNPOST_START(test_SignpostDynamic, id, "Test category", "This is dynamic signpost which you will not see, because they are off by default"); | ||
O2_SIGNPOST_END(test_SignpostDynamic, id, "Test category", "This is dynamic signpost which you will not see, because they are off by default"); | ||
O2_LOG_ENABLE_DYNAMIC(test_SignpostDynamic); | ||
#ifdef __APPLE__ | ||
// On Apple there is no way to turn on signposts in the logger, so we do not display this message | ||
O2_SIGNPOST_START(test_SignpostDynamic, id, "Test category", "This is dynamic signpost which you will see, because we turned them on"); | ||
O2_SIGNPOST_END(test_SignpostDynamic, id, "Test category", "This is dynamic signpost which you will see, because we turned them on"); | ||
#endif | ||
} |