mustBeFormatted

public static boolean mustBeFormatted(LogData logData, MetadataProcessor metadata, Set<FloggerMetadataKey<? extends Object>> keysToIgnore)

An internal helper method for logger backends which are aggressively optimized for performance. This method is a best-effort optimization and should not be necessary for most implementations. It is not a stable API and may be removed at some point in the future.

This method attempts to determine, for the given log data and log metadata, if the default message formatting performed by the other methods in this class would just result in the literal log message being used, with no additional formatting.

If this method returns false then the literal log message can be obtained via getLiteralLogMessage, otherwise it must be formatted manually.

By calling this class it is possible to more easily detect cases where using buffers to format the log message is not required. Obviously a logger backend my have its own reasons for needing buffering (e.g. prepending log site data) and those must also be taken into account.

Parameters

logData

the log statement data.

metadata

the metadata intended to be formatted with the log statement.

keysToIgnore

a set of metadata keys which are known not to appear in the final formatted message.