You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
362 B

  1. package logger
  2. import "os"
  3. type Logger interface {
  4. Printf(format string, args ...interface{})
  5. Debugf(format string, args ...interface{})
  6. }
  7. func DebugEnabled() bool {
  8. d := os.Getenv("SWAGGER_DEBUG")
  9. if d != "" && d != "false" && d != "0" {
  10. return true
  11. }
  12. d = os.Getenv("DEBUG")
  13. if d != "" && d != "false" && d != "0" {
  14. return true
  15. }
  16. return false
  17. }