#include "lix/libutil/types.hh"
#include "lix/libutil/error.hh"
#include "lix/libutil/config.hh"
#include "logging-settings.gen.inc"
Go to the source code of this file.
|
|
typedef uint64_t | nix::ActivityId |
|
| enum | nix::ActivityType {
actUnknown = 0
, actCopyPath = 100
, actFileTransfer = 101
, actRealise = 102
,
actCopyPaths = 103
, actBuilds = 104
, nix::actBuild = 105
, actOptimiseStore = 106
,
actVerifyPaths = 107
, nix::actSubstitute = 108
, nix::actQueryPathInfo = 109
, nix::actPostBuildHook = 110
,
actBuildWaiting = 111
} |
| enum | nix::ResultType {
nix::resFileLinked = 100
, nix::resBuildLogLine = 101
, resUntrustedPath = 102
, resCorruptedPath = 103
,
nix::resSetPhase = 104
, nix::resProgress = 105
, nix::resSetExpected = 106
, nix::resPostBuildLogLine = 107
} |
|
|
ActivityId | nix::getCurActivity () |
|
void | nix::setCurActivity (const ActivityId activityId) |
|
Logger * | nix::makeSimpleLogger (bool printBuildLogs) |
|
Logger * | nix::makeJSONLogger (Logger &prevLogger) |
| template<typename... Args> |
| void | nix::warn (const std::string &fs, const Args &... args) |
|
void | nix::writeLogsToStderr (std::string_view s) |
| void | nix::logFatal (std::string const &s) |
| std::optional< JSON > | nix::parseJSONMessage (const std::string &msg, std::string_view source) |
| bool | nix::handleJSONLogMessage (JSON &json, const Activity &act, std::map< ActivityId, Activity > &activities, std::string_view source, bool trusted) |
| bool | nix::handleJSONLogMessage (const std::string &msg, const Activity &act, std::map< ActivityId, Activity > &activities, std::string_view source, bool trusted) |
◆ debug
◆ logError
| #define logError |
( |
| errorInfo... | ) |
|
Value:
#define logErrorInfo(level, errorInfo...)
Definition logging.hh:270
◆ logErrorInfo
| #define logErrorInfo |
( |
| level, |
|
|
| errorInfo... ) |
Value: do { \
if ((level) <= nix::verbosity) { \
logger->logEI((level), errorInfo); \
} \
} while (0)
Print a message with the standard ErrorInfo format. In general, use these 'log' macros for reporting problems that may require user intervention or that need more explanation. Use the 'print' macros for more lightweight status messages.
◆ logWarning
| #define logWarning |
( |
| errorInfo... | ) |
|
◆ notice
| #define notice |
( |
| args... | ) |
|
Value:printMsg(lvlNotice, args)
◆ printError
| #define printError |
( |
| args... | ) |
|
◆ printInfo
| #define printInfo |
( |
| args... | ) |
|
◆ printMsg
| #define printMsg |
( |
| level, |
|
|
| args... ) |
Value:
#define printMsgUsing(loggerParam, level, args...)
Definition logging.hh:285
◆ printMsgUsing
| #define printMsgUsing |
( |
| loggerParam, |
|
|
| level, |
|
|
| args... ) |
Value: do { \
auto _lix_logger_print_lvl = level; \
if (_lix_logger_print_lvl <= nix::verbosity) { \
loggerParam->log(_lix_logger_print_lvl, fmt(args)); \
} \
} while (0)
Print a string message if the current log level is at least the specified level. Note that this has to be implemented as a macro to ensure that the arguments are evaluated lazily.
◆ printTalkative
| #define printTalkative |
( |
| args... | ) |
|
Value:printMsg(lvlTalkative, args)
◆ vomit
◆ ActivityType
| Enumerator |
|---|
| actBuild | Fields: 0: string: path to store derivation being built. 1: string: representing the machine this is being built on. Empty string if local machine. 2: int: curRound, not used anymore, always 1? 3: int: nrRounds, not used anymore always 1?
|
| actSubstitute | Fields: 0: string: store path 1: string: substituter
|
| actQueryPathInfo | Fields: 0: string: store path 1: string: substituter
|
| actPostBuildHook | Fields: 0: string: store path
|
◆ ResultType
| Enumerator |
|---|
| resFileLinked | Fields: 0: int: bytes linked
|
| resBuildLogLine | Fields: 0: string: last line
|
| resSetPhase | Fields: 0: string: phase name
|
| resProgress | Fields: 0: int: done 1: int: expected 2: int: running 3: int: failed
|
| resSetExpected | Fields: 0: int: ActivityType 1: int: expected
|
| resPostBuildLogLine | Fields: 0: string: last line
|
◆ handleJSONLogMessage() [1/2]
| bool nix::handleJSONLogMessage |
( |
const std::string & | msg, |
|
|
const Activity & | act, |
|
|
std::map< ActivityId, Activity > & | activities, |
|
|
std::string_view | source, |
|
|
bool | trusted ) |
- Parameters
-
| source | A noun phrase describing the source of the message, e.g. "the builder". |
◆ handleJSONLogMessage() [2/2]
| bool nix::handleJSONLogMessage |
( |
JSON & | json, |
|
|
const Activity & | act, |
|
|
std::map< ActivityId, Activity > & | activities, |
|
|
std::string_view | source, |
|
|
bool | trusted ) |
- Parameters
-
| source | A noun phrase describing the source of the message, e.g. "the builder". |
◆ logFatal()
| void nix::logFatal |
( |
std::string const & | s | ) |
|
Logs a fatal message as loudly as possible. This will go into syslog as well as stderr. The purpose of this function is making failures with redirected stderr louder.
◆ parseJSONMessage()
| std::optional< JSON > nix::parseJSONMessage |
( |
const std::string & | msg, |
|
|
std::string_view | source ) |
- Parameters
-
| source | A noun phrase describing the source of the message, e.g. "the builder". |
◆ warn()
template<typename... Args>
| void nix::warn |
( |
const std::string & | fs, |
|
|
const Args &... | args ) |
|
inline |
if verbosity >= lvlWarn, print a message with a yellow 'warning:' prefix.