Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
build-log.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/util/logging.hh
"
5
#include "
nix/util/serialise.hh
"
6
7
#include <list>
8
#include <map>
9
#include <string>
10
11
namespace
nix {
12
25
struct
BuildLog
:
Sink
26
{
27
private
:
28
size_t
maxTailLines;
29
30
std::list<std::string> logTail;
31
std::string currentLogLine;
32
size_t
currentLogLinePos = 0;
// to handle carriage return
33
34
bool
pendingCR =
false
;
// defer '\r' so "\r\n" is treated as a line terminator
35
36
void
flushLine();
37
38
public
:
42
std::unique_ptr<Activity>
act
;
43
47
std::map<ActivityId, Activity>
builderActivities
;
48
53
BuildLog
(
size_t
maxTailLines, std::unique_ptr<Activity>
act
);
54
60
void
operator()
(std::string_view data)
override
;
61
66
void
flush
();
67
72
const
std::list<std::string> &
getTail
()
const
73
{
74
return
logTail;
75
}
76
80
bool
hasPartialLine
()
const
81
{
82
return
!currentLogLine.empty();
83
}
84
};
85
86
}
// namespace nix
logging.hh
serialise.hh
nix::BuildLog::getTail
const std::list< std::string > & getTail() const
Definition
build-log.hh:72
nix::BuildLog::operator()
void operator()(std::string_view data) override
Definition
build-log.cc:11
nix::BuildLog::hasPartialLine
bool hasPartialLine() const
Definition
build-log.hh:80
nix::BuildLog::act
std::unique_ptr< Activity > act
Definition
build-log.hh:42
nix::BuildLog::flush
void flush()
Definition
build-log.cc:33
nix::BuildLog::builderActivities
std::map< ActivityId, Activity > builderActivities
Definition
build-log.hh:47
nix::BuildLog::BuildLog
BuildLog(size_t maxTailLines, std::unique_ptr< Activity > act)
Definition
build-log.cc:5
nix::Sink
Definition
serialise.hh:18
libstore
include
nix
store
build
build-log.hh
Generated by
1.18.0