-
Notifications
You must be signed in to change notification settings - Fork 0
/
punchclock.go
31 lines (27 loc) · 917 Bytes
/
punchclock.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
package main
import (
"fyne.io/fyne/v2/app"
"github.com/simmarn/punchclock/logging"
punchclock "github.com/simmarn/punchclock/pkg"
)
const (
RECORDPATH string = "timesheet.json"
)
func main() {
punchclock.Log = logging.Configure(logging.Config{
FileLoggingEnabled: false,
EncodeLogsAsJson: true,
ConsoleLoggingEnabled: false,
Directory: ".",
Filename: "punchclock.log",
MaxSize: 1,
MaxBackups: 3,
MaxAge: 30})
app := app.NewWithID("com.github.simmarn.punchclock")
fh := punchclock.NewFileHandler(RECORDPATH)
prefs := punchclock.NewPreferencesWrapper(app.Preferences())
controller := punchclock.NewPunchclockController(fh, prefs, app)
view := punchclock.NewMainWindowView(controller, controller.Model)
punchclock.Log.Info().Msg("Starting " + app.UniqueID())
view.ShowMainWindow()
}