mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-23 17:31:11 +01:00
- Replaced all instances of apex/log with a structured logger interface in various services, including Api, Server, Config, and others, to enhance logging consistency and context. - Updated logging calls to utilize the new logger methods, improving error tracking and service monitoring. - Added logger initialization in services and controllers to ensure proper logging setup. - Improved error handling and logging messages for better clarity during service operations. - Removed unused apex/log imports and cleaned up related code for better maintainability.
28 lines
463 B
Go
28 lines
463 B
Go
package apps
|
|
|
|
import (
|
|
"github.com/crawlab-team/crawlab/core/utils"
|
|
)
|
|
|
|
var utilsLogger = utils.NewLogger("AppsUtils")
|
|
|
|
func Start(app App) {
|
|
start(app)
|
|
}
|
|
|
|
func start(app App) {
|
|
app.Init()
|
|
go app.Start()
|
|
app.Wait()
|
|
app.Stop()
|
|
}
|
|
|
|
func initModule(name string, fn func() error) (err error) {
|
|
if err := fn(); err != nil {
|
|
utilsLogger.Errorf("init %s error: %v", name, err)
|
|
panic(err)
|
|
}
|
|
utilsLogger.Infof("initialized %s successfully", name)
|
|
return nil
|
|
}
|