You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for working on Puppy! Puppy is my go-to Swift logging lib, I really appreciate the amount of work you are investing in it.
Now to the issue. There is a section in the README, which shows how to use LogFormattable. In this example, the date value is returned by the dateFormatter function:
You see, calling the DateFormatter() constructor is a really expensive operation, and in this case, it is being called on each log event. Performance can be greatly improved by pre-initialising the DateFormatter() object, and injecting it into the formatMessage function.
There are multiple ways to address this, would you like me to create a PR?
The text was updated successfully, but these errors were encountered:
Hey @sushichop 👋🏻
First of all, thank you for working on Puppy! Puppy is my go-to Swift logging lib, I really appreciate the amount of work you are investing in it.
Now to the issue. There is a section in the README, which shows how to use
LogFormattable
. In this example, the date value is returned by thedateFormatter
function:dateFormatter
looks like this:You see, calling the
DateFormatter()
constructor is a really expensive operation, and in this case, it is being called on each log event. Performance can be greatly improved by pre-initialising theDateFormatter()
object, and injecting it into theformatMessage
function.There are multiple ways to address this, would you like me to create a PR?
The text was updated successfully, but these errors were encountered: