intf.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package core
  2. import "context"
  3. type ILogger interface {
  4. BLFatal(module string, d ...interface{})
  5. BLFatalF(module string, format string, d ...interface{})
  6. BLFatalC(module string, data map[string]string)
  7. BLPanic(module string, d ...interface{})
  8. BLPanicF(module string, format string, d ...interface{})
  9. BLPanicC(module string, data map[string]string)
  10. BLError(module string, d ...interface{})
  11. BLErrorF(module string, format string, d ...interface{})
  12. BLErrorC(module string, data map[string]string)
  13. BLWarn(module string, d ...interface{})
  14. BLWarnF(module string, format string, d ...interface{})
  15. BLWarnC(module string, data map[string]string)
  16. BLInfo(module string, d ...interface{})
  17. BLInfoF(module string, format string, d ...interface{})
  18. BLInfoC(module string, data map[string]string)
  19. BLVerbose(module string, d ...interface{})
  20. BLVerboseF(module string, format string, d ...interface{})
  21. BLVerboseC(module string, data map[string]string)
  22. BLDebug(module string, d ...interface{})
  23. BLDebugF(module string, format string, d ...interface{})
  24. BLDebugC(module string, data map[string]string)
  25. GetModuleLogger(module string) IModuleLogger
  26. }
  27. type IModuleLogger interface {
  28. Fatal(d ...interface{})
  29. FatalF(format string, d ...interface{})
  30. FatalC(data map[string]string)
  31. Panic(d ...interface{})
  32. PanicF(format string, d ...interface{})
  33. PanicC(data map[string]string)
  34. Error(d ...interface{})
  35. ErrorF(format string, d ...interface{})
  36. ErrorC(data map[string]string)
  37. Warn(d ...interface{})
  38. WarnF(format string, d ...interface{})
  39. WarnC(data map[string]string)
  40. Info(d ...interface{})
  41. InfoF(format string, d ...interface{})
  42. InfoC(data map[string]string)
  43. Verbose(d ...interface{})
  44. VerboseF(format string, d ...interface{})
  45. VerboseC(data map[string]string)
  46. Debug(d ...interface{})
  47. DebugF(format string, d ...interface{})
  48. DebugC(data map[string]string)
  49. GetModuleName() string
  50. GetSubLog(suffix string) IModuleLogger
  51. }
  52. type IModuleLogLevelLimiter interface {
  53. // LimitLogLevel limit log level for this module logger
  54. // level parameter:
  55. // 0 - no limit
  56. // 1 - under DEBUG (VERBOSE, INFO, WARN, ERROR, PANIC, FATAL) will be emit
  57. // 2 - under VERBOSE (INFO, WARN, ERROR, PANIC, FATAL) will be emit
  58. // 3 - under INFO (WARN, ERROR, PANIC, FATAL) will be emit
  59. // 4 - under WARN (ERROR, PANIC, FATAL) will be emit
  60. // other value will performance as 0
  61. LimitLogLevel(level uint8)
  62. }
  63. type IAppFramework interface {
  64. ILogger
  65. GetContext() context.Context
  66. IsGlobalDebugMode() bool
  67. SetGlobalDebugMode(en bool)
  68. }