Files
crawlab/core/apps/utils.go
Marvin Zhang a13893b627 feat: add logo printing functionality and update logger usage
- Introduced a new utility function to print a logo and welcome information for the Crawlab server, enhancing user experience during startup.
- Updated logger variable names in the apps package for consistency and clarity.
- Added a new dependency on github.com/common-nighthawk/go-figure to facilitate logo rendering.
- Improved the server command to display the logo when the server starts, provided the user is not using the pro version.
2024-12-25 13:08:56 +08:00

28 lines
443 B
Go

package apps
import (
"github.com/crawlab-team/crawlab/core/utils"
)
var logger = utils.NewLogger("Apps")
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 {
logger.Errorf("init %s error: %v", name, err)
panic(err)
}
logger.Infof("initialized %s successfully", name)
return nil
}