paint-brush
Top 6 Golang Logging Best Practicesby@wagslane
988 reads
988 reads

Top 6 Golang Logging Best Practices

by Lane Wagner4mMay 15th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Use Errors Where Appropriate, Not Strings, Wrap Errors and Format Structs Where appropriate. Use the Built-in Log Package and use the Formatters like fmt.Errorf() to log errors. Go has a built-in `error` type that makes it clear that something is wrong when the error isn’t `nil` Use the 'error' type to differentiate errors from “normal” strings. Use a function that can be used in other places to make sure functions exit without a problem in more explicit way.

People Mentioned

Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - Top 6 Golang Logging Best Practices
Lane Wagner HackerNoon profile picture
Lane Wagner

Lane Wagner

@wagslane

Founder of Boot.dev. Whining about coding sins since 2011. Committing coding sins for the same.

About @wagslane
LEARN MORE ABOUT @WAGSLANE'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Lane Wagner HackerNoon profile picture
Lane Wagner@wagslane
Founder of Boot.dev. Whining about coding sins since 2011. Committing coding sins for the same.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here