You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@yunikorn.apache.org by "Manikandan R (Jira)" <ji...@apache.org> on 2023/02/22 07:46:00 UTC

[jira] [Resolved] (YUNIKORN-1578) Use zap.Stringer instead of calling String on object

     [ https://issues.apache.org/jira/browse/YUNIKORN-1578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Manikandan R resolved YUNIKORN-1578.
------------------------------------
    Resolution: Fixed

> Use zap.Stringer instead of calling String on object
> ----------------------------------------------------
>
>                 Key: YUNIKORN-1578
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-1578
>             Project: Apache YuniKorn
>          Issue Type: Bug
>          Components: core - common, shim - kubernetes
>            Reporter: Wilfred Spiegelenburg
>            Assignee: Qi Zhu
>            Priority: Major
>              Labels: pull-request-available
>
> Throughout the code we have lots of places where we use the following call structure:
> {code:java}
> zap.String("text here", object.String()) {code}
> This causes the {{object.String()}} call to happen before we even consider if it needs to be logged. Zap has a lazy way of doing this that removes the call to create the stringĀ  until it is needed, after the level checks etc. The above call becomes:
> {code:java}
> zap.Stringer("text here", object) {code}
> Affect core and k8shim



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: dev-help@yunikorn.apache.org