You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@photowey Thank you for your proposal. I think it is valuable and needs to be done at present.
For the Logger module, I think the framework needs to be developed from two perspectives.
Built-in Logger. We can provide a logger specially used for logging in the framework-level, that is, compared to current implementations, we should adding log level, log location and other basic information on the basis of retaining 'color'.
This logger can be defined by user.
We also need to define a interface like:
// Logger is the interface for Logger typestypeLoggerinterface {
Info(args...interface{})
Warn(args...interface{})
Error(args...interface{})
Debug(args...interface{})
Fatal(args...interface{})
Infof(fmtstring, args...interface{})
Warnf(fmtstring, args...interface{})
Errorf(fmtstring, args...interface{})
Debugf(fmtstring, args...interface{})
Fatalf(fmtstring, args...interface{})
}
I suppose this interface can be placed to extension/normal/logger/logger.go
User Logger under extension/normal/logger/impl/. Developers using the framework can inject logger implementation to this logger interface in their code to print app-level logs. The module needs to provide several preset implementation classes, like extension/normal/logger/impl/console_loggerextension/normal/logger/impl/file_loggerextension/normal/logger/impl/elastic_logger and so on. Each implementation should have special param and logic, for specific usage.
All log output must be taken over by Logger. If the developer does not provide an implementation, the built-in default log implementation is used.
The text was updated successfully, but these errors were encountered: