Tomáš Pecka | 5123e00 | 2020-06-05 15:29:21 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016-2018 CESNET, https://photonics.cesnet.cz/ |
| 3 | * |
| 4 | * Written by Jan Kundrát <jan.kundrat@cesnet.cz> |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #pragma once |
| 9 | |
| 10 | #include <iostream> |
| 11 | #include <spdlog/sinks/ansicolor_sink.h> |
| 12 | #include "utils/log-init.h" |
| 13 | #include "utils/log.h" |
| 14 | |
| 15 | #define IMPL_TEST_INIT_LOGS_1 \ |
| 16 | spdlog::drop_all(); \ |
| 17 | auto test_logger = std::make_shared<spdlog::sinks::ansicolor_stderr_sink_mt>(); \ |
Tomáš Pecka | bd82886 | 2020-06-15 15:53:35 +0200 | [diff] [blame] | 18 | velia::utils::initLogs(test_logger); |
Tomáš Pecka | 5123e00 | 2020-06-05 15:29:21 +0200 | [diff] [blame] | 19 | |
| 20 | #define IMPL_TEST_INIT_LOGS_2 \ |
| 21 | spdlog::set_pattern("%S.%e [%t %n %L] %v"); \ |
| 22 | spdlog::set_level(spdlog::level::trace); \ |
| 23 | trompeloeil::stream_tracer tracer {std::cout}; |
| 24 | |
| 25 | #define TEST_INIT_LOGS \ |
| 26 | IMPL_TEST_INIT_LOGS_1 \ |
| 27 | IMPL_TEST_INIT_LOGS_2 |