chromium/third_party/abseil-cpp/absl/log/internal/log_impl.h

// Copyright 2022 The Abseil Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef ABSL_LOG_INTERNAL_LOG_IMPL_H_
#define ABSL_LOG_INTERNAL_LOG_IMPL_H_

#include "absl/log/absl_vlog_is_on.h"
#include "absl/log/internal/conditions.h"
#include "absl/log/internal/log_message.h"
#include "absl/log/internal/strip.h"

// ABSL_LOG()
#define ABSL_LOG_INTERNAL_LOG_IMPL(severity)

// ABSL_PLOG()
#define ABSL_LOG_INTERNAL_PLOG_IMPL(severity)

// ABSL_DLOG()
#ifndef NDEBUG
#define ABSL_LOG_INTERNAL_DLOG_IMPL(severity)
#else
#define ABSL_LOG_INTERNAL_DLOG_IMPL
#endif

// The `switch` ensures that this expansion is the beginning of a statement (as
// opposed to an expression). The use of both `case 0` and `default` is to
// suppress a compiler warning.
#define ABSL_LOG_INTERNAL_VLOG_IMPL(verbose_level)

#ifndef NDEBUG
#define ABSL_LOG_INTERNAL_DVLOG_IMPL(verbose_level)
#else
#define ABSL_LOG_INTERNAL_DVLOG_IMPL
#endif

#define ABSL_LOG_INTERNAL_LOG_IF_IMPL(severity, condition)
#define ABSL_LOG_INTERNAL_PLOG_IF_IMPL(severity, condition)

#ifndef NDEBUG
#define ABSL_LOG_INTERNAL_DLOG_IF_IMPL(severity, condition)
#else
#define ABSL_LOG_INTERNAL_DLOG_IF_IMPL
#endif

// ABSL_LOG_EVERY_N
#define ABSL_LOG_INTERNAL_LOG_EVERY_N_IMPL(severity, n)

// ABSL_LOG_FIRST_N
#define ABSL_LOG_INTERNAL_LOG_FIRST_N_IMPL(severity, n)

// ABSL_LOG_EVERY_POW_2
#define ABSL_LOG_INTERNAL_LOG_EVERY_POW_2_IMPL(severity)

// ABSL_LOG_EVERY_N_SEC
#define ABSL_LOG_INTERNAL_LOG_EVERY_N_SEC_IMPL(severity, n_seconds)

#define ABSL_LOG_INTERNAL_PLOG_EVERY_N_IMPL(severity, n)

#define ABSL_LOG_INTERNAL_PLOG_FIRST_N_IMPL(severity, n)

#define ABSL_LOG_INTERNAL_PLOG_EVERY_POW_2_IMPL(severity)

#define ABSL_LOG_INTERNAL_PLOG_EVERY_N_SEC_IMPL(severity, n_seconds)

#ifndef NDEBUG
#define ABSL_LOG_INTERNAL_DLOG_EVERY_N_IMPL(severity, n)

#define ABSL_LOG_INTERNAL_DLOG_FIRST_N_IMPL(severity, n)

#define ABSL_LOG_INTERNAL_DLOG_EVERY_POW_2_IMPL(severity)

#define ABSL_LOG_INTERNAL_DLOG_EVERY_N_SEC_IMPL(severity, n_seconds)

#else  // def NDEBUG
#define ABSL_LOG_INTERNAL_DLOG_EVERY_N_IMPL

#define ABSL_LOG_INTERNAL_DLOG_FIRST_N_IMPL

#define ABSL_LOG_INTERNAL_DLOG_EVERY_POW_2_IMPL

#define ABSL_LOG_INTERNAL_DLOG_EVERY_N_SEC_IMPL
#endif  // def NDEBUG

#define ABSL_LOG_INTERNAL_VLOG_EVERY_N_IMPL(verbose_level, n)

#define ABSL_LOG_INTERNAL_VLOG_FIRST_N_IMPL(verbose_level, n)

#define ABSL_LOG_INTERNAL_VLOG_EVERY_POW_2_IMPL(verbose_level)

#define ABSL_LOG_INTERNAL_VLOG_EVERY_N_SEC_IMPL(verbose_level, n_seconds)

#define ABSL_LOG_INTERNAL_LOG_IF_EVERY_N_IMPL(severity, condition, n)

#define ABSL_LOG_INTERNAL_LOG_IF_FIRST_N_IMPL(severity, condition, n)

#define ABSL_LOG_INTERNAL_LOG_IF_EVERY_POW_2_IMPL(severity, condition)

#define ABSL_LOG_INTERNAL_LOG_IF_EVERY_N_SEC_IMPL(severity, condition,  \
                                                  n_seconds)

#define ABSL_LOG_INTERNAL_PLOG_IF_EVERY_N_IMPL(severity, condition, n)

#define ABSL_LOG_INTERNAL_PLOG_IF_FIRST_N_IMPL(severity, condition, n)

#define ABSL_LOG_INTERNAL_PLOG_IF_EVERY_POW_2_IMPL(severity, condition)

#define ABSL_LOG_INTERNAL_PLOG_IF_EVERY_N_SEC_IMPL(severity, condition, \
                                                   n_seconds)

#ifndef NDEBUG
#define ABSL_LOG_INTERNAL_DLOG_IF_EVERY_N_IMPL(severity, condition, n)

#define ABSL_LOG_INTERNAL_DLOG_IF_FIRST_N_IMPL(severity, condition, n)

#define ABSL_LOG_INTERNAL_DLOG_IF_EVERY_POW_2_IMPL(severity, condition)

#define ABSL_LOG_INTERNAL_DLOG_IF_EVERY_N_SEC_IMPL(severity, condition, \
                                                   n_seconds)

#else  // def NDEBUG
#define ABSL_LOG_INTERNAL_DLOG_IF_EVERY_N_IMPL

#define ABSL_LOG_INTERNAL_DLOG_IF_FIRST_N_IMPL

#define ABSL_LOG_INTERNAL_DLOG_IF_EVERY_POW_2_IMPL

#define ABSL_LOG_INTERNAL_DLOG_IF_EVERY_N_SEC_IMPL
#endif  // def NDEBUG

#endif  // ABSL_LOG_INTERNAL_LOG_IMPL_H_