PageRenderTime 48ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/src/github.com/Sirupsen/logrus/exported.go

https://github.com/zhgwenming/docker
Go | 177 lines | 105 code | 32 blank | 40 comment | 4 complexity | d13deace58815a477ad41a81a2a1102c MD5 | raw file
Possible License(s): Apache-2.0, BSD-2-Clause, BSD-3-Clause
  1. package logrus
  2. import (
  3. "io"
  4. )
  5. var (
  6. // std is the name of the standard logger in stdlib `log`
  7. std = New()
  8. )
  9. // SetOutput sets the standard logger output.
  10. func SetOutput(out io.Writer) {
  11. std.mu.Lock()
  12. defer std.mu.Unlock()
  13. std.Out = out
  14. }
  15. // SetFormatter sets the standard logger formatter.
  16. func SetFormatter(formatter Formatter) {
  17. std.mu.Lock()
  18. defer std.mu.Unlock()
  19. std.Formatter = formatter
  20. }
  21. // SetLevel sets the standard logger level.
  22. func SetLevel(level Level) {
  23. std.mu.Lock()
  24. defer std.mu.Unlock()
  25. std.Level = level
  26. }
  27. // AddHook adds a hook to the standard logger hooks.
  28. func AddHook(hook Hook) {
  29. std.mu.Lock()
  30. defer std.mu.Unlock()
  31. std.Hooks.Add(hook)
  32. }
  33. // WithField creates an entry from the standard logger and adds a field to
  34. // it. If you want multiple fields, use `WithFields`.
  35. //
  36. // Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
  37. // or Panic on the Entry it returns.
  38. func WithField(key string, value interface{}) *Entry {
  39. return std.WithField(key, value)
  40. }
  41. // WithFields creates an entry from the standard logger and adds multiple
  42. // fields to it. This is simply a helper for `WithField`, invoking it
  43. // once for each field.
  44. //
  45. // Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
  46. // or Panic on the Entry it returns.
  47. func WithFields(fields Fields) *Entry {
  48. return std.WithFields(fields)
  49. }
  50. // Debug logs a message at level Debug on the standard logger.
  51. func Debug(args ...interface{}) {
  52. std.Debug(args...)
  53. }
  54. // Print logs a message at level Info on the standard logger.
  55. func Print(args ...interface{}) {
  56. std.Print(args...)
  57. }
  58. // Info logs a message at level Info on the standard logger.
  59. func Info(args ...interface{}) {
  60. std.Info(args...)
  61. }
  62. // Warn logs a message at level Warn on the standard logger.
  63. func Warn(args ...interface{}) {
  64. std.Warn(args...)
  65. }
  66. // Warning logs a message at level Warn on the standard logger.
  67. func Warning(args ...interface{}) {
  68. std.Warning(args...)
  69. }
  70. // Error logs a message at level Error on the standard logger.
  71. func Error(args ...interface{}) {
  72. std.Error(args...)
  73. }
  74. // Panic logs a message at level Panic on the standard logger.
  75. func Panic(args ...interface{}) {
  76. std.Panic(args...)
  77. }
  78. // Fatal logs a message at level Fatal on the standard logger.
  79. func Fatal(args ...interface{}) {
  80. std.Fatal(args...)
  81. }
  82. // Debugf logs a message at level Debug on the standard logger.
  83. func Debugf(format string, args ...interface{}) {
  84. std.Debugf(format, args...)
  85. }
  86. // Printf logs a message at level Info on the standard logger.
  87. func Printf(format string, args ...interface{}) {
  88. std.Printf(format, args...)
  89. }
  90. // Infof logs a message at level Info on the standard logger.
  91. func Infof(format string, args ...interface{}) {
  92. std.Infof(format, args...)
  93. }
  94. // Warnf logs a message at level Warn on the standard logger.
  95. func Warnf(format string, args ...interface{}) {
  96. std.Warnf(format, args...)
  97. }
  98. // Warningf logs a message at level Warn on the standard logger.
  99. func Warningf(format string, args ...interface{}) {
  100. std.Warningf(format, args...)
  101. }
  102. // Errorf logs a message at level Error on the standard logger.
  103. func Errorf(format string, args ...interface{}) {
  104. std.Errorf(format, args...)
  105. }
  106. // Panicf logs a message at level Panic on the standard logger.
  107. func Panicf(format string, args ...interface{}) {
  108. std.Panicf(format, args...)
  109. }
  110. // Fatalf logs a message at level Fatal on the standard logger.
  111. func Fatalf(format string, args ...interface{}) {
  112. std.Fatalf(format, args...)
  113. }
  114. // Debugln logs a message at level Debug on the standard logger.
  115. func Debugln(args ...interface{}) {
  116. std.Debugln(args...)
  117. }
  118. // Println logs a message at level Info on the standard logger.
  119. func Println(args ...interface{}) {
  120. std.Println(args...)
  121. }
  122. // Infoln logs a message at level Info on the standard logger.
  123. func Infoln(args ...interface{}) {
  124. std.Infoln(args...)
  125. }
  126. // Warnln logs a message at level Warn on the standard logger.
  127. func Warnln(args ...interface{}) {
  128. std.Warnln(args...)
  129. }
  130. // Warningln logs a message at level Warn on the standard logger.
  131. func Warningln(args ...interface{}) {
  132. std.Warningln(args...)
  133. }
  134. // Errorln logs a message at level Error on the standard logger.
  135. func Errorln(args ...interface{}) {
  136. std.Errorln(args...)
  137. }
  138. // Panicln logs a message at level Panic on the standard logger.
  139. func Panicln(args ...interface{}) {
  140. std.Panicln(args...)
  141. }
  142. // Fatalln logs a message at level Fatal on the standard logger.
  143. func Fatalln(args ...interface{}) {
  144. std.Fatalln(args...)
  145. }