chromium/components/policy/core/common/policy_logger.cc

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

#include "components/policy/core/common/policy_logger.h"

#include <deque>
#include <string_view>
#include <utility>

#include "base/check_is_test.h"
#include "base/functional/bind.h"
#include "base/i18n/time_formatting.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "components/policy/core/common/features.h"
#include "components/version_info/version_info.h"

namespace policy {

namespace {

// The base format for the Chromium Code Search URLs.
constexpr char kChromiumCSUrlFormat[] =;

// Gets the string value for the log source.
std::string GetLogSourceValue(const PolicyLogger::Log::Source log_source) {}

std::string GetLogSeverity(const PolicyLogger::Log::Severity log_severity) {}

int GetLogSeverityInt(const PolicyLogger::Log::Severity log_severity) {}

// Constructs the URL for Chromium Code Search that points to the line of code
// that generated the log and the Chromium git revision hash.
std::string GetLineURL(const char* file, int line) {}

// Checks if the log has been if the list for at least `kTimeToLive` minutes.
bool IsLogExpired(PolicyLogger::Log& log) {}

}  // namespace

PolicyLogger::Log::Log(const Severity log_severity,
                       const Source log_source,
                       const std::string& message,
                       const std::string_view file,
                       const int line)
    :{}
PolicyLogger* PolicyLogger::GetInstance() {}

PolicyLogger::LogHelper::LogHelper(
    const LogType log_type,
    const PolicyLogger::Log::Severity log_severity,
    const int log_verbosity,
    const PolicyLogger::Log::Source log_source,
    const std::string_view file,
    const int line)
    :{}

PolicyLogger::LogHelper::~LogHelper() {}

void PolicyLogger::LogHelper::StreamLog() const {}

base::Value::Dict PolicyLogger::Log::GetAsDict() const {}

PolicyLogger::PolicyLogger() = default;
PolicyLogger::~PolicyLogger() = default;

void PolicyLogger::AddLog(PolicyLogger::Log&& new_log) {}

void PolicyLogger::DeleteOldLogs() {}

void PolicyLogger::ScheduleOldLogsDeletion() {}

base::Value::List PolicyLogger::GetAsList() {}

void PolicyLogger::EnableLogDeletion() {}

size_t PolicyLogger::GetPolicyLogsSizeForTesting() {}

void PolicyLogger::ResetLoggerForTesting() {}

}  // namespace policy