|
@@ -0,0 +1,85 @@
|
|
|
+package core
|
|
|
+
|
|
|
+import "context"
|
|
|
+
|
|
|
+type ILogger interface {
|
|
|
+ Fatal(module string, d ...interface{})
|
|
|
+ FatalF(module string, format string, d ...interface{})
|
|
|
+ FatalC(module string, data map[string]string)
|
|
|
+
|
|
|
+ Panic(module string, d ...interface{})
|
|
|
+ PanicF(module string, format string, d ...interface{})
|
|
|
+ PanicC(module string, data map[string]string)
|
|
|
+
|
|
|
+ Error(module string, d ...interface{})
|
|
|
+ ErrorF(module string, format string, d ...interface{})
|
|
|
+ ErrorC(module string, data map[string]string)
|
|
|
+
|
|
|
+ Warn(module string, d ...interface{})
|
|
|
+ WarnF(module string, format string, d ...interface{})
|
|
|
+ WarnC(module string, data map[string]string)
|
|
|
+
|
|
|
+ Info(module string, d ...interface{})
|
|
|
+ InfoF(module string, format string, d ...interface{})
|
|
|
+ InfoC(module string, data map[string]string)
|
|
|
+
|
|
|
+ Verbose(module string, d ...interface{})
|
|
|
+ VerboseF(module string, format string, d ...interface{})
|
|
|
+ VerboseC(module string, data map[string]string)
|
|
|
+
|
|
|
+ Debug(module string, d ...interface{})
|
|
|
+ DebugF(module string, format string, d ...interface{})
|
|
|
+ DebugC(module string, data map[string]string)
|
|
|
+
|
|
|
+ GetModuleLogger(module string) IModuleLogger
|
|
|
+}
|
|
|
+
|
|
|
+type IModuleLogger interface {
|
|
|
+ Fatal(d ...interface{})
|
|
|
+ FatalF(format string, d ...interface{})
|
|
|
+ FatalC(data map[string]string)
|
|
|
+
|
|
|
+ Panic(d ...interface{})
|
|
|
+ PanicF(format string, d ...interface{})
|
|
|
+ PanicC(data map[string]string)
|
|
|
+
|
|
|
+ Error(d ...interface{})
|
|
|
+ ErrorF(format string, d ...interface{})
|
|
|
+ ErrorC(data map[string]string)
|
|
|
+
|
|
|
+ Warn(d ...interface{})
|
|
|
+ WarnF(format string, d ...interface{})
|
|
|
+ WarnC(data map[string]string)
|
|
|
+
|
|
|
+ Info(d ...interface{})
|
|
|
+ InfoF(format string, d ...interface{})
|
|
|
+ InfoC(data map[string]string)
|
|
|
+
|
|
|
+ Verbose(d ...interface{})
|
|
|
+ VerboseF(format string, d ...interface{})
|
|
|
+ VerboseC(data map[string]string)
|
|
|
+
|
|
|
+ Debug(d ...interface{})
|
|
|
+ DebugF(format string, d ...interface{})
|
|
|
+ DebugC(data map[string]string)
|
|
|
+
|
|
|
+ GetModuleName() string
|
|
|
+ GetSubLog(suffix string) IModuleLogger
|
|
|
+}
|
|
|
+
|
|
|
+type IModuleLogLevelLimiter interface {
|
|
|
+ // LimitLogLevel limit log level for this module logger
|
|
|
+ // level parameter:
|
|
|
+ // 0 - no limit
|
|
|
+ // 1 - under DEBUG (VERBOSE, INFO, WARN, ERROR, PANIC, FATAL) will be emit
|
|
|
+ // 2 - under VERBOSE (INFO, WARN, ERROR, PANIC, FATAL) will be emit
|
|
|
+ // 3 - under INFO (WARN, ERROR, PANIC, FATAL) will be emit
|
|
|
+ // 4 - under WARN (ERROR, PANIC, FATAL) will be emit
|
|
|
+ // other value will performance as 0
|
|
|
+ LimitLogLevel(level uint8)
|
|
|
+}
|
|
|
+
|
|
|
+type IAppFramework interface {
|
|
|
+ ILogger
|
|
|
+ GetContext() context.Context
|
|
|
+}
|