vlog.h 701 B

1234567891011121314151617181920212223
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #ifndef CARBON_COMMON_VLOG_H_
  5. #define CARBON_COMMON_VLOG_H_
  6. #include "common/vlog_internal.h"
  7. namespace Carbon {
  8. // Logs when verbose logging is enabled (vlog_stream_ is non-null).
  9. //
  10. // For example:
  11. // CARBON_VLOG() << "Verbose message";
  12. #define CARBON_VLOG() \
  13. __builtin_expect(vlog_stream_ == nullptr, true) \
  14. ? (void)0 \
  15. : CARBON_VLOG_INTERNAL_STREAM(vlog_stream_)
  16. } // namespace Carbon
  17. #endif // CARBON_COMMON_VLOG_H_