Flox Package Database 1
CRUD Operations on Nix Package Metadata
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
flox::FilteredLogger Class Reference

Custom nix::Logger implementation used to filter some messages. More...

Inheritance diagram for flox::FilteredLogger:

Public Member Functions

 FilteredLogger (bool printBuildLogs)
 
bool isVerbose () override
 Whether the logger prints the whole build log.
 
void warn (const std::string &msg) override
 Emit a log message with a colored "warning:" prefix.
 
void log (nix::Verbosity lvl, std::string_view str) override
 Emit a log line depending on verbosity setting.
 
void logEI (const nix::ErrorInfo &einfo) override
 Emit error information.
 
void startActivity (nix::ActivityId, nix::Verbosity lvl, nix::ActivityType, const std::string &str, const Fields &, nix::ActivityId) override
 Begin an activity block.
 
void result (nix::ActivityId, nix::ResultType type, const Fields &fields) override
 Report the result of an RPC call with a remote nix store.
 

Public Attributes

bool systemd
 
bool tty
 
bool color
 
bool printBuildLogs
 

Protected Member Functions

bool shouldIgnoreWarning (const std::string &str)
 Detect ignored warnings.
 
bool shouldIgnoreMsg (std::string_view str)
 Detect ignored messages.
 

Detailed Description

Custom nix::Logger implementation used to filter some messages.

This is an exact copy of nix::SimpleLogger with the addition of filtering in the log routine.

Member Function Documentation

◆ log()

void flox::FilteredLogger::log ( nix::Verbosity  lvl,
std::string_view  str 
)
inlineoverride

Emit a log line depending on verbosity setting.

Parameters
lvlMinimum required verbosity level to emit the message.
strThe message to emit.

◆ shouldIgnoreWarning()

bool flox::FilteredLogger::shouldIgnoreWarning ( const std::string &  str)
inlineprotected

Detect ignored warnings.

In theory this is normally controlled by verbosity, but because the verbosity setting conditionals exist in external libs, we have to handle them here.

Member Data Documentation

◆ color

bool flox::FilteredLogger::color

Whether we should emit colors in logs.

◆ printBuildLogs

bool flox::FilteredLogger::printBuildLogs

Whether we should emit build logs.

◆ systemd

bool flox::FilteredLogger::systemd

Whether we should emit systemd style logs.

◆ tty

bool flox::FilteredLogger::tty

Whether we are connected to a TTY.


The documentation for this class was generated from the following file: