Google Cloud C++ Client
2.7.0
C++ Client Library for Google Cloud Platform
tracing_options.h
Go to the documentation of this file.
1
// Copyright 2020 Google LLC
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// https://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#
ifndef
GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACING_OPTIONS_H
16
#
define
GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACING_OPTIONS_H
17
18
#
include
"google/cloud/version.h"
19
#
include
<
cstdint
>
20
#
include
<
string
>
21
22
namespace
google
{
23
namespace
cloud
{
24
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
25
/**
26
* The configuration parameters for RPC/protobuf tracing.
27
*
28
* The default options are:
29
* single_line_mode=on
30
* use_short_repeated_primitives=on
31
* truncate_string_field_longer_than=128
32
*/
33
class
TracingOptions
{
34
public
:
35
TracingOptions
() =
default
;
36
TracingOptions
(
TracingOptions
const
&) =
default
;
37
TracingOptions
&
operator
=(
TracingOptions
const
&) =
default
;
38
TracingOptions
(
TracingOptions
&&) =
default
;
39
TracingOptions
&
operator
=(
TracingOptions
&&) =
default
;
40
41
friend
bool
operator
==(
TracingOptions
const
& a,
TracingOptions
const
& b);
42
friend
bool
operator
!=(
TracingOptions
const
& a,
TracingOptions
const
& b) {
43
return
!(a
==
b);
44
}
45
46
/// Override the default options with values from @p `str`.
47
TracingOptions
&
SetOptions
(std::string
const
& str);
48
49
/// The entire message will be output on a single line with no line breaks.
50
bool
single_line_mode
()
const
{
return
single_line_mode_; }
51
52
/// Print repeated primitives in a compact format instead of each value on
53
/// its own line.
54
bool
use_short_repeated_primitives
()
const
{
55
return
use_short_repeated_primitives_;
56
}
57
58
/// If non-zero, truncate all string/bytes fields longer than this.
59
std::int64_t
truncate_string_field_longer_than
()
const
{
60
return
truncate_string_field_longer_than_;
61
}
62
63
private
:
64
bool
single_line_mode_ =
true
;
65
bool
use_short_repeated_primitives_ =
true
;
66
std::int64_t truncate_string_field_longer_than_ = 128;
67
};
68
69
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
70
}
// namespace cloud
71
}
// namespace google
72
73
#
endif
// GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACING_OPTIONS_H
Generated on Wed Feb 1 2023 20:24:33 for Google Cloud C++ Client by
1.9.1