The performance (may be) improved if the logger holds a reference to it's parent, instead of cloning the entire base fields, preHooks, postHooks and outputs slices/maps.
At the useReference branch, there's some suggestion:
type hooksChain struct {
parent *hooksChain
hooks Hooks
}
If this struct is used inside the logger struct, replacing the old baseFields, preHooks/postHooks and outputs field types, they will continue to have the same behavior.
The performance (may be) improved if the logger holds a reference to it's parent, instead of cloning the entire base fields, preHooks, postHooks and outputs slices/maps.
At the
useReferencebranch, there's some suggestion:If this struct is used inside the
loggerstruct, replacing the oldbaseFields,preHooks/postHooksandoutputsfield types, they will continue to have the same behavior.