chromium/media/base/logging_override_if_enabled.h

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_BASE_LOGGING_OVERRIDE_IF_ENABLED_H_
#define MEDIA_BASE_LOGGING_OVERRIDE_IF_ENABLED_H_

// Provides a way to override DVLOGs to at build time.
// Warning: Do NOT include this file in .h files to avoid unexpected override.
// TODO(xhwang): Provide a way to choose which |verboselevel| to override.

#include "build/build_config.h"
#include "media/media_buildflags.h"

#if BUILDFLAG(ENABLE_LOGGING_OVERRIDE)
#if !defined(DVLOG)
#error This file must be included after base/logging.h.
#endif

#if BUILDFLAG(IS_FUCHSIA)

#define __DVLOG_0
#define __DVLOG_1
#define __DVLOG_2

#else

#define __DVLOG_0
#define __DVLOG_1
#define __DVLOG_2

#endif  // BUILDFLAG(IS_FUCHSIA)

#define __DVLOG_3
#define __DVLOG_4
#define __DVLOG_5

#undef DVLOG
#define DVLOG

#endif  // BUILDFLAG(ENABLE_LOGGING_OVERRIDE)

#endif  // MEDIA_BASE_LOGGING_OVERRIDE_IF_ENABLED_H_