sugar.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package log
  2. func Debug(args ...any) {
  3. sugaredLogger.Debug(args...)
  4. }
  5. func Info(args ...any) {
  6. sugaredLogger.Info(args...)
  7. }
  8. func Warn(args ...any) {
  9. sugaredLogger.Warn(args...)
  10. }
  11. func Error(args ...any) {
  12. sugaredLogger.Error(args...)
  13. }
  14. func Debugf(format string, args ...interface{}) {
  15. sugaredLogger.Debugf(format, args...)
  16. }
  17. // Infof logs a message at level Info on the standard logger.
  18. func Infof(format string, args ...interface{}) {
  19. sugaredLogger.Infof(format, args...)
  20. }
  21. // Warnf logs a message at level Warn on the standard logger.
  22. func Warnf(format string, args ...interface{}) {
  23. sugaredLogger.Warnf(format, args...)
  24. }
  25. // Errorf logs a message at level Error on the standard logger.
  26. func Errorf(format string, args ...interface{}) {
  27. sugaredLogger.Errorf(format, args...)
  28. }
  29. // Panicf logs a message at level Panic on the standard logger.
  30. func Panicf(format string, args ...interface{}) {
  31. sugaredLogger.Panicf(format, args...)
  32. }
  33. // Fatalf logs a message at level Fatal on the standard logger then the process will exit with status set to 1.
  34. func Fatalf(format string, args ...interface{}) {
  35. sugaredLogger.Fatalf(format, args...)
  36. }