test-mixed-file-console.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 //#cmake: static!
5 
6 //#cmake:add-file log-common.h
7 #include "log-common.h"
8 
9 
10 TEST_CASE( "Mixed file & console logging", "[log]" ) {
11 
12  char filename[L_tmpnam];
13  tmpnam( filename );
14 
15  TRACE( "Filename logging to: " << filename );
18 
19  // Following should log to both, meaning the file should get one line:
20  log_all();
21 
22  el::Loggers::flushAll(); // requires static!
23  REQUIRE( count_lines( filename ) == 1 );
24 }
void log_all()
Definition: log-common.h:35
size_t count_lines(char const *filename)
Definition: log-common.h:48
REQUIRE(n_callbacks==1)
TEST_CASE("Mixed file & console logging","[log]")
static void flushAll(void)
Flushes all loggers for all levels - Be careful if you dont know how many loggers are registered...
void log_to_file(rs2_log_severity min_severity, const char *file_path=nullptr)
Definition: rs.hpp:26
void log_to_console(rs2_log_severity min_severity)
Definition: rs.hpp:19
REQUIRE_NOTHROW(rs2_log(RS2_LOG_SEVERITY_INFO,"Log message using rs2_log()", nullptr))


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:11