#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 {
constexpr char kChromiumCSUrlFormat[] = …;
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) { … }
std::string GetLineURL(const char* file, int line) { … }
bool IsLogExpired(PolicyLogger::Log& log) { … }
}
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() { … }
}