Refactor data logging
Closed this issue · 3 comments
This is a high-level issue for better data logging. Future issues should split this into smaller sub-problems.
performance-layers output two types of logs: event/data logs (layer_data->Log()
) and debug logs (LOG(WARNING) <<
). We would like to refactor the former one such that layers do not have to worry about the exact output file and output format, yet be able to select from multiple ones.
The goal is to support future logging formats, e.g., chrome event traces.
Requirements:
- The new classes should be internally-synchronized and not require any mutexes.
- We should be able to unit-test the implementation without having to run the layers.
- Do not introduce any new abseil code.
The final set of classes may look something like this:
graph TD;
aa(Attribute);
Int64Attr-->aa;
StringAttr-->aa;
DurationAttr-->aa;
TimestampAttr-->aa;
...Atr -->aa;
ae(Event);
aa -.->|Contains one or more| ae;
graph LR;
ae(Event);
EventA-->ae;
EventB-->ae;
EventC-->ae;
el(EventLogger);
cl(LeafLogger);
ae-.->|AddEvent| el;
el-->BroadcastLogger;
el-->FilterLogger;
el-->cl;
graph TD;
cl(LeafLogger);
TestLogger-->cl;
CsvLogger-->cl;
CommonLogger-->cl;
TraceEventLogger-->cl;
graph LR;
el(EventLogger);
ao(LogOutput);
el-.->|LogLine| ao;
ao --> StringOutput & FileOutput;
Subtasks:
Updated the issue to match the updated design.
Can you please update this issue by checking the finished subtasks? i think the only remaining subtask is the last one. Right?
@kuhar, should we close this issue?