logging changes

This commit is contained in:
watn3y 2023-12-29 07:54:27 +01:00
parent be0cc403b9
commit 02c9f2af6b
14 changed files with 96 additions and 77 deletions

View file

@ -1,5 +1,10 @@
package commonlogic
import (
"github.com/rs/zerolog/log"
"os"
)
func ContainsInt64(a []int64, b int64) bool {
for _, v := range a {
if v == b {
@ -19,3 +24,12 @@ func ContainsString(a []string, b string) bool {
return false
}
func GetFileSize(path string) (size int64) {
file, err := os.Stat(path)
if err != nil {
log.Error().Err(err).Msg("Failed to stat " + path)
return 0
}
return file.Size()
}