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
I'm fairly new to Go still, so there is probably an obvious way to handle this, but is there an easy way to mute log messages generated by your package when errors are encountered?
I did some digging last night to see if Go handles this in the same way as Python does and got back mixed information. One example I did find common to both was setting up a package level (exported) logger instance/object and setting its output to disabled by default. The package user could then opt to enable the package-level logger if they need to see relevant troubleshooting/verbose details from the package. Not sure if that's overkill for this package or if it would be "freeing" in a sense to allow for more potential logging.
I think I might be rambling at this point, so I'll leave off here.
I'm fairly new to Go still, so there is probably an obvious way to handle this, but is there an easy way to mute log messages generated by your package when errors are encountered?
For example:
go-teams-notify/send.go
Lines 49 to 54 in feea812
Here the message is both logged and returned to the caller. From my app I've got the error message that was returned, but I also get the log output.
To work around that I've used an approach like this to temporarily mute all log output:
Is this the recommended approach, or is there a way to more directly target log messages generated by this package?
Thanks in advance for your time.
The text was updated successfully, but these errors were encountered: