blob: 6a74f263050b24125b83c7bd65ac105a8165e049 [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áš Pecka7c6b1d32020-11-25 14:17:21 +010012namespace velia::utils {
Tomáš Pecka5123e002020-06-05 15:29:21 +020013
14/** @short Initialize logging
15
16Creates and registers all required loggers and connect them to the provided sink.
17*/
18void initLogs(std::shared_ptr<spdlog::sinks::sink> sink)
19{
Tomáš Pecka292bc9c2021-01-11 22:03:11 +010020 for (const auto& name : {"main", "health", "hardware", "sysrepo", "system"}) {
Tomáš Pecka5123e002020-06-05 15:29:21 +020021 spdlog::register_logger(std::make_shared<spdlog::logger>(name, sink));
22 }
23}
24}