-
-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce structured, field logging (#87)
* feat: introduce structured, field logging The logging is currently minimal and only for initial message of listening and user login attempts * chore: major version upgarde there was a breaking API change in 8cd6d0a for which the git tag was v4.0.0 but the Go SIV was missed. This commit updates the SIV and retracts the defective version of v4.1.0.
- Loading branch information
1 parent
5701cbb
commit 8a8650d
Showing
8 changed files
with
64 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,9 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"github.com/hacdias/webdav/v3/lib" | ||
"log" | ||
"os" | ||
"os/signal" | ||
"runtime" | ||
"syscall" | ||
"time" | ||
|
||
"github.com/hacdias/webdav/v3/cmd" | ||
"github.com/hacdias/webdav/v4/cmd" | ||
) | ||
|
||
func main() { | ||
runtime.GOMAXPROCS(runtime.NumCPU()) | ||
ctx, cancel := context.WithCancel(context.Background()) | ||
|
||
go lib.LastRequestLogIndex(ctx) | ||
go cmd.Execute() | ||
|
||
sigterm := make(chan os.Signal, 1) | ||
signal.Notify(sigterm, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT) | ||
|
||
<-sigterm | ||
log.Println("receive stop signal") | ||
|
||
cancel() | ||
// wait for other goroutines to quit | ||
time.Sleep(2 * time.Second) | ||
cmd.Execute() | ||
} |