log.go 884 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. // Package log is a wrapper of logs for short calling name.
  5. package log
  6. import (
  7. "github.com/gogits/logs"
  8. )
  9. var logger *logs.BeeLogger
  10. func NewLogger(bufLen int64, mode, config string) {
  11. logger = logs.NewLogger(bufLen)
  12. logger.SetLogger(mode, config)
  13. }
  14. func Trace(format string, v ...interface{}) {
  15. logger.Trace(format, v...)
  16. }
  17. func Debug(format string, v ...interface{}) {
  18. logger.Debug(format, v...)
  19. }
  20. func Info(format string, v ...interface{}) {
  21. logger.Info(format, v...)
  22. }
  23. func Error(format string, v ...interface{}) {
  24. logger.Error(format, v...)
  25. }
  26. func Warn(format string, v ...interface{}) {
  27. logger.Warn(format, v...)
  28. }
  29. func Critical(format string, v ...interface{}) {
  30. logger.Critical(format, v...)
  31. }