blob: 69b43766c3b19eaf9883d58f5687fe48ef28f390 [file] [log] [blame]
Tomáš Pecka5123e002020-06-05 15:29:21 +02001/*
2 * Copyright (C) 2016-2019 CESNET, https://photonics.cesnet.cz/
3 *
4 * Written by Jan Kundrát <jan.kundrat@cesnet.cz>
5 *
6*/
7
8#include <vector>
9#include "utils/log-init.h"
10#include "utils/log.h"
11
Tomáš Peckabd828862020-06-15 15:53:35 +020012namespace velia {
Tomáš Pecka5123e002020-06-05 15:29:21 +020013namespace utils {
14
15/** @short Initialize logging
16
17Creates and registers all required loggers and connect them to the provided sink.
18*/
19void initLogs(std::shared_ptr<spdlog::sinks::sink> sink)
20{
Tomáš Peckaefd88432020-06-17 15:31:39 +020021 for (const auto& name : std::vector<std::string> {"main", "manager", "input", "output"}) {
Tomáš Pecka5123e002020-06-05 15:29:21 +020022 spdlog::register_logger(std::make_shared<spdlog::logger>(name, sink));
23 }
24}
25}
26}