mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-21 07:51:28 +02:00
fix logs not printing correctly, removed unneccessary loggers
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"github.com/rs/zerolog"
|
||||
E "github.com/yusing/go-proxy/internal/error"
|
||||
"github.com/yusing/go-proxy/internal/logging"
|
||||
"github.com/yusing/go-proxy/internal/task"
|
||||
"github.com/yusing/go-proxy/internal/watcher/events"
|
||||
)
|
||||
@@ -40,13 +41,13 @@ func NewDirectoryWatcher(parent task.Parent, dirPath string) *DirWatcher {
|
||||
//! subdirectories are not watched
|
||||
w, err := fsnotify.NewWatcher()
|
||||
if err != nil {
|
||||
logger.Panic().Err(err).Msg("unable to create fs watcher")
|
||||
logging.Panic().Err(err).Msg("unable to create fs watcher")
|
||||
}
|
||||
if err = w.Add(dirPath); err != nil {
|
||||
logger.Panic().Err(err).Msg("unable to create fs watcher")
|
||||
logging.Panic().Err(err).Msg("unable to create fs watcher")
|
||||
}
|
||||
helper := &DirWatcher{
|
||||
Logger: logger.With().
|
||||
Logger: logging.With().
|
||||
Str("type", "dir").
|
||||
Str("path", dirPath).
|
||||
Logger(),
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/rs/zerolog"
|
||||
D "github.com/yusing/go-proxy/internal/docker"
|
||||
E "github.com/yusing/go-proxy/internal/error"
|
||||
"github.com/yusing/go-proxy/internal/logging"
|
||||
"github.com/yusing/go-proxy/internal/watcher/events"
|
||||
)
|
||||
|
||||
@@ -55,7 +56,7 @@ func NewDockerWatcher(host string) DockerWatcher {
|
||||
return DockerWatcher{
|
||||
host: host,
|
||||
clientOwned: true,
|
||||
Logger: logger.With().
|
||||
Logger: logging.With().
|
||||
Str("type", "docker").
|
||||
Str("host", host).
|
||||
Logger(),
|
||||
@@ -65,7 +66,7 @@ func NewDockerWatcher(host string) DockerWatcher {
|
||||
func NewDockerWatcherWithClient(client *D.SharedClient) DockerWatcher {
|
||||
return DockerWatcher{
|
||||
client: client,
|
||||
Logger: logger.With().
|
||||
Logger: logging.With().
|
||||
Str("type", "docker").
|
||||
Str("host", client.DaemonHost()).
|
||||
Logger(),
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package watcher
|
||||
|
||||
import "github.com/yusing/go-proxy/internal/logging"
|
||||
|
||||
var logger = logging.With().Str("module", "watcher").Logger()
|
||||
Reference in New Issue
Block a user