ceph-csi icon indicating copy to clipboard operation
ceph-csi copied to clipboard

Standardise logging, error message formatting,wrapping etc across codebase

Open Rakshith-R opened this issue 4 years ago • 6 comments

Describe the feature you'd like to have

Standardised logging, error message formatting,wrapping etc across code base.

Currently, we use a variety of logging (Info,Debug,Error) and error formatting ("failed with ... with err %w" , "failed with ... : %w" ). Its good to document these and keep it uniform across codebase.

How will we know we have a good solution? (acceptance criteria)

  • Standard documented format used across code base.

Add a list of criteria that should be met for this feature to be useful

  • Ease of interpretation error/log messages and implementation.
  • Consensus and acceptance of the standardised format.

Please comment your suggestions below.

cc @nixpanic @yati1998

Rakshith-R avatar Aug 06 '21 04:08 Rakshith-R

@Rakshith-R Yes true, there are lots of un-uniformity across the codebase regarding logging, error messages, etc. It will be good to document a fixed format and have small patches to fix it.

yati1998 avatar Aug 06 '21 05:08 yati1998

Yes, standardization on logging format would be nice.

I prefer the format like "failed to do something: %w", err, not including the string with error:. For cases where errors are nested, there would be a repetition of with error: which only takes space and does not add any value (it should be obvious that after the : the nested error is added).

nixpanic avatar Aug 06 '21 08:08 nixpanic

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Sep 05 '21 21:09 github-actions[bot]

@Yuggupta27 considering we havent made progress here, I am removing this from release 3.6 tracker and tracking for release 3.7.

humblec avatar Apr 01 '22 05:04 humblec

@Yuggupta27 considering we havent made progress here, I am removing this from release 3.7 tracker and tracking for release 3.8.

humblec avatar Aug 18 '22 05:08 humblec

Sure, I am currently caught up with other things so un-assigning myself from this issue for the time being.

Yuggupta27 avatar Aug 18 '22 06:08 Yuggupta27