defaultSigZone.hpp
Go to the documentation of this file.
1
2#pragma once
3
7
8namespace by {
9 template <typename W> class defaultSigZone: public sigZone {
10 BY(ME(defaultSigZone, sigZone))
11
12 public:
13 defaultSigZone(const W& worker):
14 super([&](const baseErr& e) {
15 enablesZone zone;
16 zone.setEnable(true);
17
18 logger& log = logger::get();
19 log.logBypass("\n* * *\n");
20 log.logBypass("unexpected exception found: ");
21 e.dump();
22
23 if(worker.isFlag(W::LOG_STRUCTURE)) {
24 log.logBypass("\ncurrent frames:\n");
25 thread::get().getFrames();
26 }
27
28 if(worker.isFlag(W::LOG_GRAPH_ON_EX)) {
29 log.logBypass("\ngraph:\n");
30 graphVisitor().setFlag(0).setTask(worker.getTask()).work();
31 }
32
33 // signale will *terminate* the process after all.
34 }) {}
35 };
36}
Base class for all error types.
Definition: baseErr.hpp:12
void dump() const override
Dump object state for debugging.
Definition: defaultSigZone.hpp:9
Temporary scope-based enable/disable zone for logging streams.
Definition: enablesZone.hpp:14
AST graph visualization visitor.
Definition: graphVisitor.hpp:11
Main logging interface for the byeol language system.
Definition: logger.hpp:15
static logger & get()
Get singleton logger instance.
Signal handler zone management.
Definition: sigZone.hpp:10
Base worker template for processing tasks.
Definition: worker.hpp:28