blob: c0ff3ab61ddfcfcfe43a9c38d3510d79d87af173 [file] [log] [blame]
// Copyright 2025 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_DATA_SHARING_PUBLIC_LOGGER_UTILS_H_
#define COMPONENTS_DATA_SHARING_PUBLIC_LOGGER_UTILS_H_
#include "base/logging.h"
// Helper macro to make logging easier and expose file metadata about the log
// source.
#define DATA_SHARING_LOG(log_source, logger, message) \
do { \
if (logger && logger->ShouldEnableDebugLogs()) [[unlikely]] { \
logger->Log(base::Time::Now(), log_source, __FILE__, __LINE__, message); \
} \
} while (0)
#endif // COMPONENTS_DATA_SHARING_PUBLIC_LOGGER_UTILS_H_