22#include "absl/strings/string_view.h"
42Result<LogSeverity>
ToSeverity(absl::string_view value);
57 const std::string& path,
67void SetLoggers(std::vector<SeverityTarget> destinations,
68 const std::string& log_prefix =
"");
73 std::optional<LogSeverity> severity = std::nullopt);
77void LogToFiles(
const std::vector<std::string>& files,
78 const std::string& log_prefix =
"");
84 const std::vector<std::string>& files,
const std::string& log_prefix =
"",
86 std::optional<LogSeverity> stderr_severity = std::nullopt);
Definition: tee_logging.cpp:211
Definition: tee_logging.h:91
~ScopedLogger()
Definition: tee_logging.cpp:377
ScopedLogger(SeverityTarget target, const std::string &prefix)
Definition: tee_logging.cpp:372
std::unique_ptr< LogSink > log_sink_
Definition: tee_logging.h:97
Definition: shared_fd.h:125
absl::string_view prefix
Definition: kernel_log_server.cc:45
Definition: alloc_driver.h:21
MetadataLevel
Definition: tee_logging.h:49
constexpr const char * kFileSeverityEnvVar
Definition: tee_logging.h:30
std::string StripColorCodes(const std::string &str)
Definition: tee_logging.cpp:176
LogSeverity
Definition: tee_logging.h:32
Result< LogSeverity > ToSeverity(absl::string_view value)
Definition: tee_logging.cpp:282
std::string FromSeverity(LogSeverity severity)
Definition: tee_logging.cpp:264
void LogToStderrAndFiles(const std::vector< std::string > &files, const std::string &log_prefix, MetadataLevel stderr_level, std::optional< LogSeverity > stderr_severity)
Definition: tee_logging.cpp:360
void LogToStderr(const std::string &log_prefix, MetadataLevel metadata_level, std::optional< LogSeverity > severity)
Definition: tee_logging.cpp:350
void SetLoggers(std::vector< SeverityTarget > destinations, const std::string &log_prefix)
Definition: tee_logging.cpp:324
void LogToFiles(const std::vector< std::string > &files, const std::string &log_prefix)
Definition: tee_logging.cpp:355
LogSeverity ConsoleSeverity()
Definition: tee_logging.cpp:311
constexpr const char * kConsoleSeverityEnvVar
Definition: tee_logging.h:29
LogSeverity LogFileSeverity()
Definition: tee_logging.cpp:315
Definition: tee_logging.h:51
LogSeverity severity
Definition: tee_logging.h:52
static SeverityTarget FromFd(SharedFD fd, MetadataLevel metadata_level=MetadataLevel::FULL, LogSeverity severity=LogSeverity::Verbose)
Definition: tee_logging.cpp:206
MetadataLevel metadata_level
Definition: tee_logging.h:54
static SeverityTarget FromFile(const std::string &path, MetadataLevel metadata_level=MetadataLevel::FULL, LogSeverity severity=LogSeverity::Verbose)
Definition: tee_logging.cpp:193
SharedFD target
Definition: tee_logging.h:53