Skip to content

Commit

Permalink
minor: better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
FMotalleb committed Jun 6, 2024
1 parent 77cb6dd commit 6486788
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
14 changes: 5 additions & 9 deletions config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
description: Backup the production database
enabled: true
tasks:
- command: echo 15
- command: pwd --greg
retries: 3
retry-delay: 123s
retry-delay: 1s
timeout: 15s
env:
DB_HOST: 10.0.0.5
Expand All @@ -17,13 +17,9 @@ jobs:
schedulers:
- cron: "* * * * * *"
- interval: 1s
- at: 2024/05/15
# - at: 2024/05/15
hooks:
done:
- post: http://google.com/
headers:
test: test2
- command: echo Ok
failed:
- post: http://google.com/
headers:
test: test2
- command: echo Failed
6 changes: 2 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ func main() {
logger.InitFromConfig()
log = logger.SetupLogger("Crontab-GO")
cronInstance := cron.New(cron.WithSeconds())

log.Info("Booting up")
log.Infoln(cmd.CFG)
for _, job := range cmd.CFG.Jobs {
if !job.Enabled {
log.Warn("job %s is disabled", job.Name)
Expand Down Expand Up @@ -87,11 +85,11 @@ func main() {
logger.Trace("Signals Built")
signal := goutils.Zip(signals...)

logger.Infof("Zipping Signals")
logger.Trace("Zipping Signals")
go func() {
logger.Debug("Spawned work goroutine")
for range signal {
logger.Debug("Signal Received")
logger.Trace("Signal Received")
for _, task := range tasks {
ctx := context.Background()
err := task.Execute(ctx)
Expand Down

0 comments on commit 6486788

Please sign in to comment.