Admiral-Piett / goaws

AWS (SQS/SNS) Clone for Development testing
MIT License
769 stars 145 forks source link

Log level fine-tuning #230

Open rokf opened 3 years ago

rokf commented 3 years ago

Hey, I propose that some kind of log level configuration logic is added to at least the gosqs part of the application.

There are two logs that are especially bothering me:

https://github.com/p4tin/goaws/blob/6ecd9bf473ad2b2a88dba5224957826665710dec/app/gosqs/gosqs.go#L401

https://github.com/p4tin/goaws/blob/6ecd9bf473ad2b2a88dba5224957826665710dec/app/gosqs/gosqs.go#L451

As the SQS instance is waiting for messages it is spamming out useless logs every second. This can be costly in certain deployment scenarios.

How about introducing an error log level?

I've also noticed that the flag configuration logic in https://github.com/p4tin/goaws/blob/7aca39ed52f1b6b5ad83767a5dd6dc320fea8c8d/app/cmd/goaws.go#L22 is mentioning that the warning level is the default log level, however that is not true - it's the info level.

Admiral-Piett commented 9 months ago

Good point rokf no reason to print anything at this point. We can make these debug level logs, and clean up the help logic.