-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.go
49 lines (41 loc) · 921 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/adyzng/GoSymbols/cmd"
"github.com/adyzng/GoSymbols/config"
"github.com/urfave/cli"
log "gopkg.in/clog.v1"
)
func init() {
fpath, _ := filepath.Abs(config.LogPath)
if err := os.MkdirAll(filepath.Dir(fpath), 666); err != nil {
fmt.Printf("[App] Create log folder failed: %v.", err)
}
log.New(log.FILE, log.FileConfig{
Level: log.TRACE,
Filename: filepath.Join(fpath, "app.log"),
BufferSize: 2048,
FileRotationConfig: log.FileRotationConfig{
Rotate: true,
MaxDays: 30,
MaxSize: 50 * (1 << 20),
},
})
}
const APP_VER = "0.0.0.1"
func main() {
app := cli.NewApp()
app.Name = config.AppName
app.Usage = "A self-service symbol store"
app.Version = APP_VER
app.Commands = []cli.Command{
cmd.Web,
cmd.Admin,
cmd.AddBuild,
}
app.Flags = append(app.Flags, []cli.Flag{}...)
app.Run(os.Args)
log.Shutdown()
}