Skip to content

Commit 5ca0bb0

Browse files
committed
fix log path bug
1 parent 4a6f207 commit 5ca0bb0

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

framework/command/app.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,13 @@ var appStartCommand = &cobra.Command{
171171
if err != nil {
172172
return err
173173
}
174-
gspt.SetProcTitle("hade app")
174+
175+
//processName := os.Args[0]
176+
processName := "hade app"
177+
if len(os.Args) > 0 {
178+
processName = filepath.Base(os.Args[0]) + " app"
179+
}
180+
gspt.SetProcTitle(processName)
175181

176182
fmt.Println("app serve url:", appAddress)
177183
if err := startAppServe(server, container); err != nil {

framework/command/build.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ package command
22

33
import (
44
"fmt"
5+
"github.com/erikdubbelboer/gspt"
56
"log"
7+
"os"
68
"os/exec"
9+
"path/filepath"
710

811
"github.com/gohade/hade/framework/cobra"
912
)
@@ -45,7 +48,15 @@ var buildSelfCommand = &cobra.Command{
4548
fmt.Println("--------------")
4649
return err
4750
}
48-
fmt.Println("编译hade成功")
51+
52+
//processName := os.Args[0]
53+
processName := "hade"
54+
if len(os.Args) > 0 {
55+
processName = filepath.Base(os.Args[0])
56+
}
57+
gspt.SetProcTitle(processName)
58+
59+
fmt.Println("编译" + processName + "成功")
4960
return nil
5061
},
5162
}

framework/provider/log/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (l *HadeLogServiceProvider) Register(c framework.Container) framework.NewIn
3636
}
3737

3838
cs := tcs.(contract.Config)
39-
l.Driver = strings.ToLower(cs.GetString("log.Driver"))
39+
l.Driver = strings.ToLower(cs.GetString("log.driver"))
4040
}
4141

4242
// 根据driver的配置项确定

storage/log/.gitignore

Whitespace-only changes.

storage/runtime/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)