Skip to content
This repository was archived by the owner on Jun 21, 2019. It is now read-only.

Commit df9f51b

Browse files
committed
add log to file
1 parent 183ac66 commit df9f51b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ productTree.json
1212
conf/custom.ini
1313
output*
1414
docs
15+
*.log

main.go

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

33
import (
44
"fmt"
5+
"io"
6+
"os"
57
"runtime"
68
"strings"
9+
710
"github.com/Unknwon/i18n"
811
"github.com/go-xweb/log"
912
"github.com/go-xweb/xweb"
@@ -13,7 +16,7 @@ import (
1316
)
1417

1518
const (
16-
APP_VER = "0.4.1019"
19+
APP_VER = "0.4.0213"
1720
)
1821

1922
func main() {
@@ -26,6 +29,14 @@ func main() {
2629
isPro = false
2730
}
2831
log.Info("run in " + mode + " mode")
32+
f, err := os.Create("./website.log")
33+
if err != nil {
34+
fmt.Println(err)
35+
return
36+
}
37+
38+
log.SetOutput(io.MultiWriter(f, os.Stdout))
39+
xweb.SetLogger(log.Std)
2940

3041
actions.InitApp()
3142

0 commit comments

Comments
 (0)