HomePhabricator

logging: Logger optimizations

Authored by Eevans on Sep 18 2019, 4:38 PM.

Description

logging: Logger optimizations

As implemented, string formatting occurred as part of the creation of
LogMessages, which were then passed to a logging method that would
accept or reject them based on the configured level. This was OK,
because no DEBUG logging had yet been added, but that will soon
change.

This changeset alters Logger.log(...) to accept a function that
returns a LogMessage struct, instead of the LogMessage itself.
This allows construction of the message (including any string
formatting) to occur only after it has been accepted for delivery.

Tests have also been included.

Bug: T209110
Change-Id: I3913f5342384d5c06f544f82c43f43f0e7570b4b

Details

Committed
EevansSep 18 2019, 9:04 PM
Parents
rMSKS249587a6fefe: (Actually )be data-center aware.
Branches
Unknown
Tags
Unknown
ChangeId
I3913f5342384d5c06f544f82c43f43f0e7570b4b