Previously, the SetFormatter method method came with the requirement
that the formatter provided needed to be a logrus.Formatter component.
This exposed the internal components of the pkg log framework, making
the addition of concepts (such as hooks) also reliant on these internal
components.
This change adds two types: Entry and Formatter, where Formatter is
responsible for formatting a log Entry. Backwards compatibility is
maintained with the SetFormatter method (through type checking) to
support the setting of logrus.Formatter components. However, this
change is not completely backwards compatible because the exported
Formatter name, previously an integer type value, now represents the
formatting object. The previous Formatter name has been renamed to
FormatterType.
Previously, the SetFormatter method method came with the requirement that the formatter provided needed to be a logrus.Formatter component. This exposed the internal components of the pkg log framework, making the addition of concepts (such as hooks) also reliant on these internal components.
This change adds two types: Entry and Formatter, where Formatter is responsible for formatting a log Entry. Backwards compatibility is maintained with the SetFormatter method (through type checking) to support the setting of logrus.Formatter components. However, this change is not completely backwards compatible because the exported Formatter name, previously an integer type value, now represents the formatting object. The previous Formatter name has been renamed to FormatterType.