glog_api.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // Copyright 2017 gf Author(https://github.com/gogf/gf). 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. // See Print.
  18. func Println(v ...interface{}) {
  19. logger.Println(v...)
  20. }
  21. // Fatal prints the logging content with [FATA] header and newline, then exit the current process.
  22. func Fatal(v ...interface{}) {
  23. logger.Fatal(v...)
  24. }
  25. // Fatalf prints the logging content with [FATA] header, custom format and newline, then exit the current process.
  26. func Fatalf(format string, v ...interface{}) {
  27. logger.Fatalf(format, v...)
  28. }
  29. // Panic prints the logging content with [PANI] header and newline, then panics.
  30. func Panic(v ...interface{}) {
  31. logger.Panic(v...)
  32. }
  33. // Panicf prints the logging content with [PANI] header, custom format and newline, then panics.
  34. func Panicf(format string, v ...interface{}) {
  35. logger.Panicf(format, v...)
  36. }
  37. // Info prints the logging content with [INFO] header and newline.
  38. func Info(v ...interface{}) {
  39. logger.Info(v...)
  40. }
  41. // Infof prints the logging content with [INFO] header, custom format and newline.
  42. func Infof(format string, v ...interface{}) {
  43. logger.Infof(format, v...)
  44. }
  45. // Debug prints the logging content with [DEBU] header and newline.
  46. func Debug(v ...interface{}) {
  47. logger.Debug(v...)
  48. }
  49. // Debugf prints the logging content with [DEBU] header, custom format and newline.
  50. func Debugf(format string, v ...interface{}) {
  51. logger.Debugf(format, v...)
  52. }
  53. // Notice prints the logging content with [NOTI] header and newline.
  54. // It also prints caller stack info if stack feature is enabled.
  55. func Notice(v ...interface{}) {
  56. logger.Notice(v...)
  57. }
  58. // Noticef prints the logging content with [NOTI] header, custom format and newline.
  59. // It also prints caller stack info if stack feature is enabled.
  60. func Noticef(format string, v ...interface{}) {
  61. logger.Noticef(format, v...)
  62. }
  63. // Warning prints the logging content with [WARN] header and newline.
  64. // It also prints caller stack info if stack feature is enabled.
  65. func Warning(v ...interface{}) {
  66. logger.Warning(v...)
  67. }
  68. // Warningf prints the logging content with [WARN] header, custom format and newline.
  69. // It also prints caller stack info if stack feature is enabled.
  70. func Warningf(format string, v ...interface{}) {
  71. logger.Warningf(format, v...)
  72. }
  73. // Error prints the logging content with [ERRO] header and newline.
  74. // It also prints caller stack info if stack feature is enabled.
  75. func Error(v ...interface{}) {
  76. logger.Error(v...)
  77. }
  78. // Errorf prints the logging content with [ERRO] header, custom format and newline.
  79. // It also prints caller stack info if stack feature is enabled.
  80. func Errorf(format string, v ...interface{}) {
  81. logger.Errorf(format, v...)
  82. }
  83. // Critical prints the logging content with [CRIT] header and newline.
  84. // It also prints caller stack info if stack feature is enabled.
  85. func Critical(v ...interface{}) {
  86. logger.Critical(v...)
  87. }
  88. // Criticalf prints the logging content with [CRIT] header, custom format and newline.
  89. // It also prints caller stack info if stack feature is enabled.
  90. func Criticalf(format string, v ...interface{}) {
  91. logger.Criticalf(format, v...)
  92. }