My Project 3.2.0
C++ Distributed Hash Table
Loading...
Searching...
No Matches
log.h
1/*
2 * Copyright (C) 2014-2023 Savoir-faire Linux Inc.
3 *
4 * Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include "def.h"
23#include "logger.h"
24
25#include <iostream>
26#include <memory>
27
28namespace dht {
29
30class DhtRunner;
31
35namespace log {
36
37OPENDHT_PUBLIC
38std::shared_ptr<Logger> getStdLogger();
39
40OPENDHT_PUBLIC
41std::shared_ptr<Logger> getFileLogger(const std::string &path);
42
43OPENDHT_PUBLIC
44std::shared_ptr<Logger> getSyslogLogger(const char* name);
45
46OPENDHT_PUBLIC void
47enableLogging(dht::DhtRunner &dht);
48
49OPENDHT_PUBLIC void
50enableFileLogging(dht::DhtRunner &dht, const std::string &path);
51
52OPENDHT_PUBLIC void
53disableLogging(dht::DhtRunner &dht);
54
55OPENDHT_PUBLIC void
56enableSyslog(dht::DhtRunner &dht, const char* name);
57
58} /* log */
59} /* dht */