Flow 1.0.1
Flow project: Full implementation reference.
verbosity_config_fwd.hpp
Go to the documentation of this file.
1/* Flow
2 * Copyright 2023 Akamai Technologies, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the
5 * "License"); you may not use this file except in
6 * compliance with the License. You may obtain a copy
7 * of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in
12 * writing, software distributed under the License is
13 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
14 * CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing
16 * permissions and limitations under the License. */
17
18/// @file
19#pragma once
20
21#include <iostream>
22
23namespace flow::log
24{
25
26// Types.
27
28// Find doc headers near the bodies of these compound types.
29
30class Verbosity_config;
31
32// Free functions.
33
34/**
35 * Deserializes a Verbosity_config from a standard input stream by invoking `val.parse(is)`.
36 * `val.last_result_message()` can be used to glean the success or failure of this operation.
37 *
38 * @relatesalso Verbosity_config
39 *
40 * @param is
41 * Stream from which to deserialize.
42 * @param val
43 * Value to set.
44 * @return `is`.
45 */
46std::istream& operator>>(std::istream& is, Verbosity_config& val);
47
48/**
49 * Serializes a Verbosity_config to a standard output stream.
50 *
51 * @relatesalso Verbosity_config
52 *
53 * @param os
54 * Stream to which to serialize.
55 * @param val
56 * Value to serialize.
57 * @return `os`.
58 */
59std::ostream& operator<<(std::ostream& os, const Verbosity_config& val);
60
61/**
62 * Checks for exact equality of two Verbosity_config objects. (Note that this is not maximally clever, in that if
63 * (`val1 == val2`), then they *definitely* produce the same Config all else being equal; but if
64 * the reverse is true, then it is possible they differently expressed values producing the same actual result.
65 * E.g., something like `ALL:INFO` differs from `ALL:WARN;ALL:INFO` -- yet they have the same effect. However
66 * component names are normalized internally when parsing, so that won't produce false inequality.)
67 *
68 * Only Verbosity_config::component_sev_pairs() is significant in this comparison; last_result_message() is not.
69 *
70 * @relatesalso Verbosity_config
71 *
72 * @param val1
73 * Object to compare.
74 * @param val2
75 * Object to compare.
76 * @return `true` if definitely equal; `false` if possibly not equal.
77 */
78bool operator==(const Verbosity_config& val1, const Verbosity_config& val2);
79
80/**
81 * Returns `!(val1 == val2)`.
82 *
83 * @relatesalso Verbosity_config
84 *
85 * @param val1
86 * Object to compare.
87 * @param val2
88 * Object to compare.
89 * @return See above.
90 */
91bool operator!=(const Verbosity_config& val1, const Verbosity_config& val2);
92
93} // namespace flow::log
Flow module providing logging functionality.
std::ostream & operator<<(std::ostream &os, Sev val)
Serializes a log::Sev to a standard output stream.
Definition: log.cpp:249
std::istream & operator>>(std::istream &is, Sev &val)
Deserializes a log::Sev from a standard input stream.
Definition: log.cpp:269
bool operator==(const Verbosity_config &val1, const Verbosity_config &val2)
Checks for exact equality of two Verbosity_config objects.
bool operator!=(const Verbosity_config &val1, const Verbosity_config &val2)
Returns !(val1 == val2).