-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCCLogger.cpp
More file actions
43 lines (36 loc) · 984 Bytes
/
CCLogger.cpp
File metadata and controls
43 lines (36 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// CCLogger.cpp
// ncc
//
// Created by yuki on 2022/04/21.
//
#include "CCLogger.hpp"
CCLogger::~CCLogger() {
log_separator("End");
}
void CCLogger::loginput(shared_ptr<CCExecutionInput> input) {
log_separator("Command");
cout << endl;
writer->p(input->commandline)->endl();
for (auto file: input->file_contents) {
log_separator(file.first);
writer->p(file.second)->endl();
}
}
void CCLogger::logresult(shared_ptr<CommandResult> result) {
log_separator("Status");
if (result->kind == CommandResult::Kind::Success) {
writer->p("Success")->endl();
} else {
writer->p("Failure")->p("(")->p(result->exit_code)->p(")")->endl();
}
log_separator("Output");
writer->p(result->output)->endl();
}
void CCLogger::close() {
writer->close();
}
void CCLogger::log_separator(string name) {
writer->p("-----ncc")->p(uuid)->p("-----")->endl();
writer->p(":")->p(name)->p(":")->endl();
}