Merge "Add support for logging package name." into pi-dev

This commit is contained in:
Mathew Inwood 2018-05-02 10:39:15 +00:00 committed by Android (Google) Code Review
commit 979931803b
2 changed files with 7 additions and 0 deletions

View file

@ -47,6 +47,8 @@ class ComplexEventLogger {
public:
// Create a complex event with category|category|.
explicit ComplexEventLogger(int category);
// Set the package name that this event originates from.
void SetPackageName(const std::string& package_name);
// Add tagged data to the event, with the given tag and integer value.
void AddTaggedData(int tag, int32_t value);
// Add tagged data to the event, with the given tag and string value.
@ -70,6 +72,7 @@ enum {
LOGBUILDER_VALUE = 802,
LOGBUILDER_COUNTER = 803,
LOGBUILDER_HISTOGRAM = 804,
LOGBUILDER_PACKAGENAME = 806,
ACTION_BOOT = 1098,
FIELD_PLATFORM_REASON = 1099,

View file

@ -62,6 +62,10 @@ ComplexEventLogger::ComplexEventLogger(int category) : logger(kSysuiMultiActionT
logger << LOGBUILDER_CATEGORY << category;
}
void ComplexEventLogger::SetPackageName(const std::string& package_name) {
logger << LOGBUILDER_PACKAGENAME << package_name;
}
void ComplexEventLogger::AddTaggedData(int tag, int32_t value) {
logger << tag << value;
}