ipfs-chromium
Loading...
Searching...
No Matches
logger.h
1#ifndef IPFS_LOGGER_H_
2#define IPFS_LOGGER_H_
3
4#include <string>
5
6namespace ipfs::log {
7
8enum class Level {
9 Trace = -2,
10 Debug = -1,
11 Info = 0,
12 Warn = 1,
13 Error = 2,
14 Fatal = 3,
15 Off
16};
17
18void SetLevel(Level);
19
20using Handler = void (*)(std::string const&, char const*, int, Level);
21void SetHandler(Handler) noexcept;
22
23void DefaultHandler(std::string const& message,
24 char const* source_file,
25 int source_line,
26 Level for_prefix);
27
28std::string_view LevelDescriptor(Level);
29
30bool IsInitialized() noexcept;
31
32} // namespace ipfs::log
33
34#endif // LOGGER_H