-
Such as a logger like: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
No, there isn't a way to update existing fields, as zap encodes fields as they're added to the logger. You can add the same field multiple times (#81), but that may lead to undefined behaviour, so I'd recommend using a separate log field. |
Beta Was this translation helpful? Give feedback.
-
what if the value is a function that returns something or if the value is a pointer to a struct field? |
Beta Was this translation helpful? Give feedback.
No, there isn't a way to update existing fields, as zap encodes fields as they're added to the logger.
You can add the same field multiple times (#81), but that may lead to undefined behaviour, so I'd recommend using a separate log field.