PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/Godeps/_workspace/src/github.com/Sirupsen/logrus/exported.go

https://github.com/ironcladlou/kubernetes
Go | 182 lines | 108 code | 33 blank | 41 comment | 4 complexity | a74efb14b2b787c64059d4962fefba97 MD5 | raw file
Possible License(s): BSD-3-Clause, MIT, LGPL-3.0, Apache-2.0, JSON, BSD-2-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. // GetLevel returns the standard logger level.
  28. func GetLevel() Level {
  29. return std.Level
  30. }
  31. // AddHook adds a hook to the standard logger hooks.
  32. func AddHook(hook Hook) {
  33. std.mu.Lock()
  34. defer std.mu.Unlock()
  35. std.Hooks.Add(hook)
  36. }
  37. // WithField creates an entry from the standard logger and adds a field to
  38. // it. If you want multiple fields, use `WithFields`.
  39. //
  40. // Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
  41. // or Panic on the Entry it returns.
  42. func WithField(key string, value interface{}) *Entry {
  43. return std.WithField(key, value)
  44. }
  45. // WithFields creates an entry from the standard logger and adds multiple
  46. // fields to it. This is simply a helper for `WithField`, invoking it
  47. // once for each field.
  48. //
  49. // Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
  50. // or Panic on the Entry it returns.
  51. func WithFields(fields Fields) *Entry {
  52. return std.WithFields(fields)
  53. }
  54. // Debug logs a message at level Debug on the standard logger.
  55. func Debug(args ...interface{}) {
  56. std.Debug(args...)
  57. }
  58. // Print logs a message at level Info on the standard logger.
  59. func Print(args ...interface{}) {
  60. std.Print(args...)
  61. }
  62. // Info logs a message at level Info on the standard logger.
  63. func Info(args ...interface{}) {
  64. std.Info(args...)
  65. }
  66. // Warn logs a message at level Warn on the standard logger.
  67. func Warn(args ...interface{}) {
  68. std.Warn(args...)
  69. }
  70. // Warning logs a message at level Warn on the standard logger.
  71. func Warning(args ...interface{}) {
  72. std.Warning(args...)
  73. }
  74. // Error logs a message at level Error on the standard logger.
  75. func Error(args ...interface{}) {
  76. std.Error(args...)
  77. }
  78. // Panic logs a message at level Panic on the standard logger.
  79. func Panic(args ...interface{}) {
  80. std.Panic(args...)
  81. }
  82. // Fatal logs a message at level Fatal on the standard logger.
  83. func Fatal(args ...interface{}) {
  84. std.Fatal(args...)
  85. }
  86. // Debugf logs a message at level Debug on the standard logger.
  87. func Debugf(format string, args ...interface{}) {
  88. std.Debugf(format, args...)
  89. }
  90. // Printf logs a message at level Info on the standard logger.
  91. func Printf(format string, args ...interface{}) {
  92. std.Printf(format, args...)
  93. }
  94. // Infof logs a message at level Info on the standard logger.
  95. func Infof(format string, args ...interface{}) {
  96. std.Infof(format, args...)
  97. }
  98. // Warnf logs a message at level Warn on the standard logger.
  99. func Warnf(format string, args ...interface{}) {
  100. std.Warnf(format, args...)
  101. }
  102. // Warningf logs a message at level Warn on the standard logger.
  103. func Warningf(format string, args ...interface{}) {
  104. std.Warningf(format, args...)
  105. }
  106. // Errorf logs a message at level Error on the standard logger.
  107. func Errorf(format string, args ...interface{}) {
  108. std.Errorf(format, args...)
  109. }
  110. // Panicf logs a message at level Panic on the standard logger.
  111. func Panicf(format string, args ...interface{}) {
  112. std.Panicf(format, args...)
  113. }
  114. // Fatalf logs a message at level Fatal on the standard logger.
  115. func Fatalf(format string, args ...interface{}) {
  116. std.Fatalf(format, args...)
  117. }
  118. // Debugln logs a message at level Debug on the standard logger.
  119. func Debugln(args ...interface{}) {
  120. std.Debugln(args...)
  121. }
  122. // Println logs a message at level Info on the standard logger.
  123. func Println(args ...interface{}) {
  124. std.Println(args...)
  125. }
  126. // Infoln logs a message at level Info on the standard logger.
  127. func Infoln(args ...interface{}) {
  128. std.Infoln(args...)
  129. }
  130. // Warnln logs a message at level Warn on the standard logger.
  131. func Warnln(args ...interface{}) {
  132. std.Warnln(args...)
  133. }
  134. // Warningln logs a message at level Warn on the standard logger.
  135. func Warningln(args ...interface{}) {
  136. std.Warningln(args...)
  137. }
  138. // Errorln logs a message at level Error on the standard logger.
  139. func Errorln(args ...interface{}) {
  140. std.Errorln(args...)
  141. }
  142. // Panicln logs a message at level Panic on the standard logger.
  143. func Panicln(args ...interface{}) {
  144. std.Panicln(args...)
  145. }
  146. // Fatalln logs a message at level Fatal on the standard logger.
  147. func Fatalln(args ...interface{}) {
  148. std.Fatalln(args...)
  149. }