diff options
| author | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-06 22:16:37 +0200 |
|---|---|---|
| committer | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-06 22:16:37 +0200 |
| commit | 913a974eca2522ba7c6d27066481bb2c6635db53 (patch) | |
| tree | f0cfc1ee173a762662b586fca5db9db422592093 /watcher_test.go | |
| parent | 5f2ba9c3d37a1c8658aea411188a6763e982b1ab (diff) | |
| download | sourcewatch-913a974eca2522ba7c6d27066481bb2c6635db53.tar.gz sourcewatch-913a974eca2522ba7c6d27066481bb2c6635db53.zip | |
Add log level system and sync logging
- log.go: log level system (DEBUG, INFO, WARN, ERROR, NONE)
- CLI: -log-level flag (default info), -verbose as shorthand for debug
- Watcher: logs sync/remove actions at INFO level
- Watcher: logs events at DEBUG level
- Errors: structured error messages (DISK FULL, PERMISSION DENIED, etc.)
- Updated README with -log-level flag
Diffstat (limited to 'watcher_test.go')
| -rw-r--r-- | watcher_test.go | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/watcher_test.go b/watcher_test.go index 8fac419..df16930 100644 --- a/watcher_test.go +++ b/watcher_test.go @@ -20,7 +20,7 @@ func TestWatcher_Create(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -42,7 +42,7 @@ func TestWatcher_CreateInSubdir(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -66,7 +66,7 @@ func TestWatcher_Write(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -90,7 +90,7 @@ func TestWatcher_Remove(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -114,7 +114,7 @@ func TestWatcher_Rename(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -139,7 +139,7 @@ func TestWatcher_IgnoredFileEvents(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -167,7 +167,7 @@ func TestWatcher_Debouncing(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -199,7 +199,7 @@ func TestWatcher_CreateDirectory(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -229,7 +229,7 @@ func TestWatcher_RemoveDirectory(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -255,7 +255,7 @@ func TestWatcher_VerifyManifestUpdated(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -282,7 +282,7 @@ func TestWatcher_NestedGitignore_CreateIgnored(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -310,7 +310,7 @@ func TestWatcher_NestedGitignore_CreateUnignore(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -332,7 +332,7 @@ func TestWatcher_CreateSymlink(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -382,7 +382,7 @@ func TestWatcher_UpdateSymlinkTarget(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -421,7 +421,7 @@ func TestWatcher_RemoveSymlink(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) @@ -447,7 +447,7 @@ func TestWatcher_ModifySymlinkTargetFile(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go watch(ctx, host, data, manifest, stack, false, false) + go watch(ctx, host, data, manifest, stack, false) time.Sleep(100 * time.Millisecond) |
