intf.go 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. DiscardSubLoggerByPrefix(prefix string)
  27. }
  28. type IModuleLogger interface {
  29. Fatal(d ...interface{})
  30. FatalF(format string, d ...interface{})
  31. FatalC(data map[string]string)
  32. Panic(d ...interface{})
  33. PanicF(format string, d ...interface{})
  34. PanicC(data map[string]string)
  35. Error(d ...interface{})
  36. ErrorF(format string, d ...interface{})
  37. ErrorC(data map[string]string)
  38. Warn(d ...interface{})
  39. WarnF(format string, d ...interface{})
  40. WarnC(data map[string]string)
  41. Info(d ...interface{})
  42. InfoF(format string, d ...interface{})
  43. InfoC(data map[string]string)
  44. Verbose(d ...interface{})
  45. VerboseF(format string, d ...interface{})
  46. VerboseC(data map[string]string)
  47. Debug(d ...interface{})
  48. DebugF(format string, d ...interface{})
  49. DebugC(data map[string]string)
  50. GetModuleName() string
  51. GetSubLog(suffix string) IModuleLogger
  52. CloseSubLog(suffix string)
  53. CloseThisLog()
  54. }
  55. type IModuleLogLevelLimiter interface {
  56. // LimitLogLevel limit log level for this module logger
  57. // level parameter:
  58. // 0 - no limit
  59. // 1 - under DEBUG (VERBOSE, INFO, WARN, ERROR, PANIC, FATAL) will be emit
  60. // 2 - under VERBOSE (INFO, WARN, ERROR, PANIC, FATAL) will be emit
  61. // 3 - under INFO (WARN, ERROR, PANIC, FATAL) will be emit
  62. // 4 - under WARN (ERROR, PANIC, FATAL) will be emit
  63. // other value will performance as 0
  64. LimitLogLevel(level uint8)
  65. }
  66. type IAppFramework interface {
  67. ILogger
  68. GetContext() context.Context
  69. IsGlobalDebugMode() bool
  70. SetGlobalDebugMode(en bool)
  71. }