flags.h 2.3 KB

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