|
1 |
| -#include <MoniLog.h> |
| 1 | +#include <MoniLogger.h> |
2 | 2 | #include <filesystem>
|
3 | 3 |
|
4 | 4 | PYBIND11_EMBEDDED_MODULE(example_interface, m) { }
|
5 | 5 |
|
6 | 6 | namespace fs = std::filesystem;
|
7 | 7 |
|
8 |
| -struct SimpleExecutionContext : MoniLog::MoniLogExecutionContext |
| 8 | +struct SimpleExecutionContext : MoniLogger::MoniLoggerExecutionContext |
9 | 9 | {
|
10 | 10 | const pybind11::object get_foo() const { if (foo != nullptr) return pybind11::cast(*foo); else return pybind11::cast<pybind11::none>(Py_None); }
|
11 | 11 |
|
12 | 12 | double *foo = nullptr;
|
13 | 13 |
|
14 |
| - using MoniLog::MoniLogExecutionContext::MoniLogExecutionContext; |
| 14 | + using MoniLogger::MoniLoggerExecutionContext::MoniLoggerExecutionContext; |
15 | 15 | };
|
16 | 16 |
|
17 | 17 | int main()
|
@@ -46,35 +46,35 @@ int main()
|
46 | 46 | };
|
47 | 47 |
|
48 | 48 | // Define base execution events emitted by the application, to which moniloggers can register.
|
49 |
| - MoniLog::register_base_events({ |
| 49 | + MoniLogger::register_base_events({ |
50 | 50 | {"SomeEvent", 0},
|
51 | 51 | {"SomeOtherEvent", 1}
|
52 | 52 | });
|
53 | 53 |
|
54 | 54 | // Define a composite event, emitted when either of its triggering events are emitted.
|
55 |
| - MoniLog::register_composite_event("SomeCompositeEvent", {"SomeEvent", "SomeOtherEvent"}); |
| 55 | + MoniLogger::register_composite_event("SomeCompositeEvent", {"SomeEvent", "SomeOtherEvent"}); |
56 | 56 |
|
57 | 57 | // Instantiating the execution context accessible from Python.
|
58 | 58 | std::shared_ptr<SimpleExecutionContext> ctx(new SimpleExecutionContext("SimpleExecutionContext"));
|
59 | 59 |
|
60 |
| - // Bootstrapping monilog, consisting mainly of starting the Python interpreter, initializing |
61 |
| - // the monilog module, and evaluating the provided scripts. |
62 |
| - MoniLog::bootstrap_monilog(python_path, python_scripts, interface_module, interface_module_initializer); |
| 60 | + // Bootstrapping monilogger, consisting mainly of starting the Python interpreter, initializing |
| 61 | + // the monilogger module, and evaluating the provided scripts. |
| 62 | + MoniLogger::bootstrap_monilogger(python_path, python_scripts, interface_module, interface_module_initializer); |
63 | 63 |
|
64 | 64 | double foo(0.0);
|
65 | 65 | ctx->foo = &foo;
|
66 | 66 |
|
67 | 67 | // Emitting some base events, triggering the registered moniloggers.
|
68 |
| - MoniLog::trigger(0, ctx); |
| 68 | + MoniLogger::trigger(0, ctx); |
69 | 69 |
|
70 | 70 | foo = 17.0;
|
71 | 71 |
|
72 |
| - MoniLog::trigger(1, ctx); |
| 72 | + MoniLogger::trigger(1, ctx); |
73 | 73 |
|
74 | 74 | foo = 42.0;
|
75 | 75 |
|
76 | 76 | // Emitting a composite event (can also emit base event by name).
|
77 |
| - MoniLog::trigger("SomeCompositeEvent", ctx); |
| 77 | + MoniLogger::trigger("SomeCompositeEvent", ctx); |
78 | 78 |
|
79 | 79 | foo = 17.0;
|
80 | 80 |
|
|
0 commit comments