This issue aims to understand what we can do to avoid performing costly logging-related work that ultimately will not be of any use. For example, serializing a large object but then not logging this serialization because of the configured log level.
This may require cooperation across multiple layers of the logging system. For example:
providing internal logging APIs which help us not pay for what we don’t use (e.g. C macros that first check configured log level and then skip the evaluation of expressions, or if we were for some reason using Swift, then @autoclosure — these are both only useful in the case where the costly evaluation of an expression is performed inside the logging statement itself) — this comes under #1617
the ability to query the log output object to know whether a given message will actually be logged (e.g. OSLog’s func isEnabled(type: OSLogType) -> Bool) — this comes under #1628
This issue aims to understand what we can do to avoid performing costly logging-related work that ultimately will not be of any use. For example, serializing a large object but then not logging this serialization because of the configured log level.
This may require cooperation across multiple layers of the logging system. For example:
@autoclosure
— these are both only useful in the case where the costly evaluation of an expression is performed inside the logging statement itself) — this comes under #1617OSLog
’sfunc isEnabled(type: OSLogType) -> Bool
) — this comes under #1628┆Issue is synchronized with this Jira Task by Unito