blob: b23328cabe4899e1f538753f188b5b5b8454da7c [file] [log] [blame]
Tomáš Pecka5123e002020-06-05 15:29:21 +02001/*
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áš Peckabd828862020-06-15 15:53:35 +020018 velia::utils::initLogs(test_logger);
Tomáš Pecka5123e002020-06-05 15:29:21 +020019
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