xref: /aosp_15_r20/external/libbrillo/brillo/location_logging.h (revision 1a96fba65179ea7d3f56207137718607415c5953)
1*1a96fba6SXin Li // Copyright 2015 The Chromium OS Authors. All rights reserved.
2*1a96fba6SXin Li // Use of this source code is governed by a BSD-style license that can be
3*1a96fba6SXin Li // found in the LICENSE file.
4*1a96fba6SXin Li 
5*1a96fba6SXin Li #ifndef LIBBRILLO_BRILLO_LOCATION_LOGGING_H_
6*1a96fba6SXin Li #define LIBBRILLO_BRILLO_LOCATION_LOGGING_H_
7*1a96fba6SXin Li 
8*1a96fba6SXin Li // These macros help to log Location objects in verbose mode.
9*1a96fba6SXin Li 
10*1a96fba6SXin Li #include <base/logging.h>
11*1a96fba6SXin Li 
12*1a96fba6SXin Li #define VLOG_LOC_STREAM(from_here, verbose_level)                          \
13*1a96fba6SXin Li   logging::LogMessage((from_here).file_name(), (from_here).line_number(),  \
14*1a96fba6SXin Li                       -(verbose_level)).stream()
15*1a96fba6SXin Li 
16*1a96fba6SXin Li #define VLOG_LOC(from_here, verbose_level)                                 \
17*1a96fba6SXin Li   LAZY_STREAM(VLOG_LOC_STREAM(from_here, verbose_level),                   \
18*1a96fba6SXin Li               VLOG_IS_ON(verbose_level))
19*1a96fba6SXin Li 
20*1a96fba6SXin Li #define DVLOG_LOC(from_here, verbose_level)                                \
21*1a96fba6SXin Li   LAZY_STREAM(VLOG_LOC_STREAM(from_here, verbose_level),                   \
22*1a96fba6SXin Li               DCHECK_IS_ON() && VLOG_IS_ON(verbose_level))
23*1a96fba6SXin Li 
24*1a96fba6SXin Li #endif  // LIBBRILLO_BRILLO_LOCATION_LOGGING_H_
25