#include "components/device_event_log/device_event_log.h"
#include <string>
#include "base/logging.h"
#include "base/task/single_thread_task_runner.h"
#include "components/device_event_log/device_event_log_impl.h"
namespace device_event_log {
namespace {
const size_t kDefaultMaxEntries = …;
const int kSlowMethodThresholdMs = …;
const int kVerySlowMethodThresholdMs = …;
DeviceEventLogImpl* g_device_event_log = …;
}
const LogLevel kDefaultLogLevel = …;
void Initialize(size_t max_entries) { … }
bool IsInitialized() { … }
void Shutdown() { … }
void AddEntry(const char* file,
int line,
LogType type,
LogLevel level,
const std::string& event) { … }
void AddEntryWithDescription(const char* file,
int line,
LogType type,
LogLevel level,
const std::string& event,
const std::string& desc) { … }
std::string GetAsString(StringOrder order,
const std::string& format,
const std::string& types,
LogLevel max_level,
size_t max_events) { … }
void ClearAll() { … }
void Clear(const base::Time& begin, const base::Time& end) { … }
int GetCountByLevelForTesting(LogLevel level) { … }
namespace internal {
DeviceEventLogInstance::DeviceEventLogInstance(const char* file,
int line,
device_event_log::LogType type,
device_event_log::LogLevel level)
: … { … }
DeviceEventLogInstance::~DeviceEventLogInstance() { … }
DeviceEventSystemErrorLogInstance::DeviceEventSystemErrorLogInstance(
const char* file,
int line,
device_event_log::LogType type,
device_event_log::LogLevel level,
logging::SystemErrorCode err)
: … { … }
DeviceEventSystemErrorLogInstance::~DeviceEventSystemErrorLogInstance() { … }
ScopedDeviceLogIfSlow::ScopedDeviceLogIfSlow(LogType type,
const char* file,
const std::string& name)
: … { … }
ScopedDeviceLogIfSlow::~ScopedDeviceLogIfSlow() { … }
}
}