diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-18 13:50:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-18 13:50:18 +0200 |
commit | 2d8dc6c905dbde7da2d324a559d08af77231d062 (patch) | |
tree | 035b4f863d8e1108b185c9f7ddda41a4eeb8ddce /bbot/agent.cxx | |
parent | 2c8ca08d0407d61af1a00152e3a120a6eff938f9 (diff) |
Add --systemd-daemon option to worker
Diffstat (limited to 'bbot/agent.cxx')
-rw-r--r-- | bbot/agent.cxx | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/bbot/agent.cxx b/bbot/agent.cxx index b2beed8..8e13720 100644 --- a/bbot/agent.cxx +++ b/bbot/agent.cxx @@ -683,10 +683,6 @@ handle_signal (int sig) } } -// Right arrow followed by newline. -// -const char systemd_indent[] = "\xE2\x86\xB2\n"; - int main (int argc, char* argv[]) try @@ -696,34 +692,16 @@ try verb = ops.verbose (); - // Note that unlike other projects, here we distinguish between fail - // (critical error, agent terminates) and error (non-fatal error, agent - // continues to run). This means we should be careful not using fail - // to report normal errors and vice-versa. - // if (ops.systemd_daemon ()) { - // Map to systemd severity prefixes (see sd-daemon(3) for details). Note - // that here we assume we will never have location (like file name which - // would end up being before the prefix). - // - trace_indent = - fail.indent_ = - error.indent_ = - warn.indent_ = - info.indent_ = - text.indent_ = systemd_indent; - - fail.type_ = "<2>"; - error.type_ = "<3>"; - warn.type_ = "<4>"; - info.type_ = "<6>"; - trace_type = "<7>"; - - info << "bbot agent for " << tc_name << '/' << tc_num << - info << "toolchain id " << tc_id << - info << "CPU(s) " << ops.cpu () << - info << "RAM(kB) " << ops.ram (); + systemd_diagnostics (true); // With critical errors. + + info << "bbot agent " << BBOT_VERSION_STR << + info << "toolchain name " << tc_name << + info << "toolchain num " << tc_num << + info << "toolchain id " << tc_id << + info << "CPU(s) " << ops.cpu () << + info << "RAM(kB) " << ops.ram (); } tracer trace ("main"); |