#include "error.hh"
#include "config.hh"
#include <nlohmann/json_fwd.hpp>
Go to the source code of this file.
|
typedef uint64_t | nix::ActivityId |
|
|
enum | ActivityType {
actUnknown = 0
, actCopyPath = 100
, actFileTransfer = 101
, actRealise = 102
,
actCopyPaths = 103
, actBuilds = 104
, actBuild = 105
, actOptimiseStore = 106
,
actVerifyPaths = 107
, actSubstitute = 108
, actQueryPathInfo = 109
, actPostBuildHook = 110
,
actBuildWaiting = 111
, actFetchTree = 112
} |
|
enum | ResultType {
resFileLinked = 100
, resBuildLogLine = 101
, resUntrustedPath = 102
, resCorruptedPath = 103
,
resSetPhase = 104
, resProgress = 105
, resSetExpected = 106
, resPostBuildLogLine = 107
,
resFetchStatus = 108
} |
|
|
ActivityId | nix::getCurActivity () |
|
void | nix::setCurActivity (const ActivityId activityId) |
|
Logger * | nix::makeSimpleLogger (bool printBuildLogs) |
|
Logger * | nix::makeJSONLogger (Logger &prevLogger) |
|
std::optional< nlohmann::json > | nix::parseJSONMessage (const std::string &msg, std::string_view source) |
|
bool | nix::handleJSONLogMessage (nlohmann::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) |
|
template<typename... Args> |
void | nix::warn (const std::string &fs, const Args &... args) |
|
void | nix::writeToStderr (std::string_view s) |
|
◆ debug
Value:
std::vector< Expr * > args
Definition lexer.l:6126
◆ logError
#define logError |
( |
| errorInfo... | ) |
|
Value:logErrorInfo(lvlError, errorInfo)
◆ 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... | ) |
|
Value:logErrorInfo(lvlWarn, errorInfo)
◆ notice
#define notice |
( |
| args... | ) |
|
Value:printMsg(lvlNotice,
args)
◆ printError
#define printError |
( |
| args... | ) |
|
◆ printInfo
#define printInfo |
( |
| args... | ) |
|
◆ printMsg
#define printMsg |
( |
| level, |
|
|
| args... ) |
Value:printMsgUsing(logger, level,
args)
◆ printMsgUsing
#define printMsgUsing |
( |
| loggerParam, |
|
|
| level, |
|
|
| args... ) |
Value: do { \
auto __lvl = level; \
if (__lvl <= nix::verbosity) { \
loggerParam->log(__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
◆ warnOnce
#define warnOnce |
( |
| haveWarned, |
|
|
| args... ) |
Value: if (!haveWarned) { \
haveWarned = true; \
}
◆ 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 |
( |
nlohmann::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". |
◆ parseJSONMessage()
std::optional< nlohmann::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.