util.go 843 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Rufs - Remote Union File System
  3. *
  4. * Copyright 2017 Matthias Ladkau. All rights reserved.
  5. *
  6. * This Source Code Form is subject to the terms of the MIT
  7. * License, If a copy of the MIT License was not distributed with this
  8. * file, You can obtain one at https://opensource.org/licenses/MIT.
  9. */
  10. package export
  11. import "log"
  12. // Logging
  13. // =======
  14. /*
  15. Logger is a function which processes log messages
  16. */
  17. type Logger func(v ...interface{})
  18. /*
  19. LogError is called if an error message is logged
  20. */
  21. var LogError = Logger(log.Print)
  22. /*
  23. LogInfo is called if an info message is logged
  24. */
  25. var LogInfo = Logger(log.Print)
  26. /*
  27. LogDebug is called if a debug message is logged
  28. (by default disabled)
  29. */
  30. var LogDebug = Logger(LogNull)
  31. /*
  32. LogNull is a discarding logger to be used for disabling loggers
  33. */
  34. var LogNull = func(v ...interface{}) {
  35. }