| 1 | // Copyright 2022 The Abseil Authors. |
| 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 | // ----------------------------------------------------------------------------- |
| 16 | // File: log/log_flags.h |
| 17 | // ----------------------------------------------------------------------------- |
| 18 | // |
| 19 | // This header declares set of flags which can be used to configure Abseil |
| 20 | // Logging library behaviour at runtime. |
| 21 | |
| 22 | #ifndef ABSL_LOG_INTERNAL_FLAGS_H_ |
| 23 | #define ABSL_LOG_INTERNAL_FLAGS_H_ |
| 24 | |
| 25 | #include <string> |
| 26 | |
| 27 | #include "absl/flags/declare.h" |
| 28 | |
| 29 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 30 | // These flags should not be used in C++ code to access logging library |
| 31 | // configuration knobs. Use interfaces defined in absl/log/globals.h |
| 32 | // instead. It is still ok to use these flags on a command line. |
| 33 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 34 | |
| 35 | // Log messages at this severity or above are sent to stderr in *addition* to |
| 36 | // `LogSink`s. Defaults to `ERROR`. See log_severity.h for numeric values of |
| 37 | // severity levels. |
| 38 | ABSL_DECLARE_FLAG(int, stderrthreshold); |
| 39 | |
| 40 | // Log messages at this severity or above are logged; others are discarded. |
| 41 | // Defaults to `INFO`, i.e. log all severities. See log_severity.h for numeric |
| 42 | // values of severity levels. |
| 43 | ABSL_DECLARE_FLAG(int, minloglevel); |
| 44 | |
| 45 | // If specified in the form file:linenum, any messages logged from a matching |
| 46 | // location will also include a backtrace. |
| 47 | ABSL_DECLARE_FLAG(std::string, log_backtrace_at); |
| 48 | |
| 49 | // If true, the log prefix (severity, date, time, PID, etc.) is prepended to |
| 50 | // each message logged. Defaults to true. |
| 51 | ABSL_DECLARE_FLAG(bool, log_prefix); |
| 52 | |
| 53 | // Global log verbosity level. Default is 0. |
| 54 | ABSL_DECLARE_FLAG(int, v); |
| 55 | |
| 56 | // Per-module log verbosity level. By default is empty and is unused. |
| 57 | ABSL_DECLARE_FLAG(std::string, vmodule); |
| 58 | |
| 59 | #endif // ABSL_LOG_INTERNAL_FLAGS_H_ |
| 60 | |