Couchbase C++ SDK
1.4.0 (rev. 59aa900)
Toggle main menu visibility
Loading...
Searching...
No Matches
logger.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
/*
3
* Copyright 2020-Present Couchbase, Inc.
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*/
17
18
#pragma once
19
20
#include <functional>
21
#include <string>
22
#include <string_view>
23
24
namespace
couchbase::logger
25
{
26
enum class
log_level
{
27
trace
,
28
debug
,
29
info
,
30
warn
,
31
error
,
32
critical
,
33
off
,
34
};
35
36
struct
log_location
{
37
std::string
file
;
38
std::string
function
;
39
int
line
;
40
};
41
42
using
log_callback
= std::function<void(std::string_view,
log_level
,
log_location
)>;
43
44
void
45
register_log_callback
(
const
log_callback
& callback);
46
47
void
48
unregister_log_callback
();
49
50
void
51
set_level
(
log_level
level);
52
53
void
54
initialize_console_logger
();
55
56
void
57
initialize_file_logger
(std::string_view filename);
58
59
void
60
initialize_protocol_logger
(std::string_view filename);
61
62
void
63
flush_all_loggers
();
64
65
void
66
shutdown_all_loggers
();
67
}
// namespace couchbase::logger
couchbase::error
Definition
error.hxx:31
couchbase::logger
Definition
logger.hxx:25
couchbase::logger::register_log_callback
void register_log_callback(const log_callback &callback)
couchbase::logger::flush_all_loggers
void flush_all_loggers()
couchbase::logger::initialize_file_logger
void initialize_file_logger(std::string_view filename)
couchbase::logger::log_callback
std::function< void(std::string_view, log_level, log_location)> log_callback
Definition
logger.hxx:42
couchbase::logger::initialize_console_logger
void initialize_console_logger()
couchbase::logger::initialize_protocol_logger
void initialize_protocol_logger(std::string_view filename)
couchbase::logger::shutdown_all_loggers
void shutdown_all_loggers()
couchbase::logger::unregister_log_callback
void unregister_log_callback()
couchbase::logger::log_level
log_level
Definition
logger.hxx:26
couchbase::logger::log_level::trace
@ trace
Definition
logger.hxx:27
couchbase::logger::log_level::warn
@ warn
Definition
logger.hxx:30
couchbase::logger::log_level::off
@ off
Definition
logger.hxx:33
couchbase::logger::log_level::critical
@ critical
Definition
logger.hxx:32
couchbase::logger::log_level::debug
@ debug
Definition
logger.hxx:28
couchbase::logger::log_level::info
@ info
Definition
logger.hxx:29
couchbase::logger::set_level
void set_level(log_level level)
couchbase::logger::log_location
Definition
logger.hxx:36
couchbase::logger::log_location::line
int line
Definition
logger.hxx:39
couchbase::logger::log_location::function
std::string function
Definition
logger.hxx:38
couchbase::logger::log_location::file
std::string file
Definition
logger.hxx:37
couchbase
logger.hxx
Generated by
1.17.0