Added App().
This commit is contained in:
parent
a3671d03da
commit
9200170059
1 changed files with 14 additions and 0 deletions
|
|
@ -1,7 +1,9 @@
|
|||
package commands
|
||||
|
||||
import (
|
||||
"code.destrealm.net/zancarius/justusbot/internal/app"
|
||||
"code.destrealm.net/zancarius/justusbot/internal/settings"
|
||||
"go.destrealm.net/logging/v3"
|
||||
"go.destrealm.net/vfs"
|
||||
)
|
||||
|
||||
|
|
@ -19,6 +21,14 @@ func NewCommandHost(root vfs.VFS) (*commands, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Configure default log level before initializing anything else.
|
||||
logger := logging.Logger()
|
||||
if conf.System.Logging.Level != "" {
|
||||
logger.SetLevel(logging.LevelFromString(conf.System.Logging.Level))
|
||||
} else {
|
||||
logger.SetLevel(logging.Warning)
|
||||
}
|
||||
|
||||
cmd := &commands{
|
||||
root: root,
|
||||
settings: conf,
|
||||
|
|
@ -28,6 +38,10 @@ func NewCommandHost(root vfs.VFS) (*commands, error) {
|
|||
return cmd, nil
|
||||
}
|
||||
|
||||
func (c *commands) App() *app.App {
|
||||
return app.NewApp(c.root, c.settings)
|
||||
}
|
||||
|
||||
func (c *commands) Initalizer() *installer {
|
||||
i, _ := initInstaller(c.root, c.settings)
|
||||
return i
|
||||
|
|
|
|||
Loading…
Reference in a new issue