web client: add share mode read/write

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-05-09 19:09:43 +02:00
parent e72bb1e124
commit 1e0b3a2a8c
22 changed files with 457 additions and 108 deletions

View File

@@ -11,6 +11,7 @@ package logger
import (
"errors"
"fmt"
"io/fs"
"os"
"path/filepath"
"time"
@@ -57,7 +58,7 @@ func InitLogger(logFilePath string, logMaxSize int, logMaxBackups int, logMaxAge
SetLogTime(logUTCTime)
if isLogFilePathValid(logFilePath) {
logDir := filepath.Dir(logFilePath)
if _, err := os.Stat(logDir); os.IsNotExist(err) {
if _, err := os.Stat(logDir); errors.Is(err, fs.ErrNotExist) {
err = os.MkdirAll(logDir, os.ModePerm)
if err != nil {
fmt.Printf("unable to create log dir %#v: %v", logDir, err)