aare/examples/logger_example.cpp
Bechir Braham 91a628cd6c
pedestal (#67)
* add config files for multimodule receiving

* read subfiles with unordered and missing frames

* save work debugging

* Revert "save work debugging"

This reverts commit e791992a05efd754f93a80c980d17397eb4b6045.

* Revert "read subfiles with unordered and missing frames"

This reverts commit 1177fd129d3690db92e9597ccda62598e5a44d41.

* throw when two frames have different frame numbers

* write single part RawFile (working beta)

* correct total number of frames in master file

* add new mythen file with syncd frames

* save work

* save work for receive multimodule
multimodule config results in too much packet loss. needs more debugging.

* setup Task Distributiosn/ parallelization programming model

* read frames with same frame number

* clang-tidy fixes, formatting, add tests

* added second receiver

* Synchronize between zmq streams and merge frames

* improve readability in loop

* fix failing tests

* add simple test for merge frames

* restructure files and use top-level header

* working pedestal + tests

* test_pedestal statistics

* QA test pedestal, fix clang-tidy errors

---------

Co-authored-by: Bechir <bechir.brahem420@gmail.com>
Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2024-05-08 12:33:51 +02:00

34 lines
1.2 KiB
C++

#include "aare.hpp"
#include "aare/examples/defs.hpp"
#include <fstream>
#include <iostream>
int main() {
aare::logger::debug(LOCATION, "hello", 1, "world", std::vector<long>{1, 2, 3, 4, 5});
aare::logger::debug(LOCATION, "setting verbosity to INFO");
aare::logger::set_verbosity(aare::logger::INFO);
aare::logger::debug(LOCATION, "NOTHING SHOULD BE PRINTED");
aare::logger::info(LOCATION, "info printed");
// writing to file
std::ofstream textfile;
textfile.open("/tmp/Test.txt");
aare::logger::set_streams(textfile.rdbuf());
aare::logger::info(LOCATION, "info printed to file");
// writing with a local logger instance
aare::logger::Logger logger;
logger.set_verbosity(aare::logger::WARNING);
logger.debug(LOCATION, "NOTHING SHOULD BE PRINTED");
logger.info(LOCATION, "NOTHING SHOULD BE PRINTED");
logger.warn(LOCATION, "warning printed in std::cout");
aare::logger::info(LOCATION, "info printed in file ##");
textfile.close();
// setting file output by path
// user doesn't have to close file
aare::logger::set_output_file("/tmp/Test2.txt");
aare::logger::info(LOCATION, "info printed to Test2.txt");
return 0;
}