glog_api.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
  2. //
  3. // This Source Code Form is subject to the terms of the MIT License.
  4. // If a copy of the MIT was not distributed with this file,
  5. // You can obtain one at https://github.com/gogf/gf.
  6. package glog
  7. // Print prints `v` with newline using fmt.Sprintln.
  8. // The parameter `v` can be multiple variables.
  9. func Print(v ...interface{}) {
  10. logger.Print(v...)
  11. }
  12. // Printf prints `v` with format `format` using fmt.Sprintf.
  13. // The parameter `v` can be multiple variables.
  14. func Printf(format string, v ...interface{}) {
  15. logger.Printf(format, v...)
  16. }
  17. // Println is alias of Print.
  18. // See Print.
  19. func Println(v ...interface{}) {
  20. logger.Println(v...)
  21. }
  22. // Fatal prints the logging content with [FATA] header and newline, then exit the current process.
  23. func Fatal(v ...interface{}) {
  24. logger.Fatal(v...)
  25. }
  26. // Fatalf prints the logging content with [FATA] header, custom format and newline, then exit the current process.
  27. func Fatalf(format string, v ...interface{}) {
  28. logger.Fatalf(format, v...)
  29. }
  30. // Panic prints the logging content with [PANI] header and newline, then panics.
  31. func Panic(v ...interface{}) {
  32. logger.Panic(v...)
  33. }
  34. // Panicf prints the logging content with [PANI] header, custom format and newline, then panics.
  35. func Panicf(format string, v ...interface{}) {
  36. logger.Panicf(format, v...)
  37. }
  38. // Info prints the logging content with [INFO] header and newline.
  39. func Info(v ...interface{}) {
  40. logger.Info(v...)
  41. }
  42. // Infof prints the logging content with [INFO] header, custom format and newline.
  43. func Infof(format string, v ...interface{}) {
  44. logger.Infof(format, v...)
  45. }
  46. // Debug prints the logging content with [DEBU] header and newline.
  47. func Debug(v ...interface{}) {
  48. logger.Debug(v...)
  49. }
  50. // Debugf prints the logging content with [DEBU] header, custom format and newline.
  51. func Debugf(format string, v ...interface{}) {
  52. logger.Debugf(format, v...)
  53. }
  54. // Notice prints the logging content with [NOTI] header and newline.
  55. // It also prints caller stack info if stack feature is enabled.
  56. func Notice(v ...interface{}) {
  57. logger.Notice(v...)
  58. }
  59. // Noticef prints the logging content with [NOTI] header, custom format and newline.
  60. // It also prints caller stack info if stack feature is enabled.
  61. func Noticef(format string, v ...interface{}) {
  62. logger.Noticef(format, v...)
  63. }
  64. // Warning prints the logging content with [WARN] header and newline.
  65. // It also prints caller stack info if stack feature is enabled.
  66. func Warning(v ...interface{}) {
  67. logger.Warning(v...)
  68. }
  69. // Warningf prints the logging content with [WARN] header, custom format and newline.
  70. // It also prints caller stack info if stack feature is enabled.
  71. func Warningf(format string, v ...interface{}) {
  72. logger.Warningf(format, v...)
  73. }
  74. // Error prints the logging content with [ERRO] header and newline.
  75. // It also prints caller stack info if stack feature is enabled.
  76. func Error(v ...interface{}) {
  77. logger.Error(v...)
  78. }
  79. // Errorf prints the logging content with [ERRO] header, custom format and newline.
  80. // It also prints caller stack info if stack feature is enabled.
  81. func Errorf(format string, v ...interface{}) {
  82. logger.Errorf(format, v...)
  83. }
  84. // Critical prints the logging content with [CRIT] header and newline.
  85. // It also prints caller stack info if stack feature is enabled.
  86. func Critical(v ...interface{}) {
  87. logger.Critical(v...)
  88. }
  89. // Criticalf prints the logging content with [CRIT] header, custom format and newline.
  90. // It also prints caller stack info if stack feature is enabled.
  91. func Criticalf(format string, v ...interface{}) {
  92. logger.Criticalf(format, v...)
  93. }