diff options
author | Valery Piashchynski <[email protected]> | 2020-12-16 21:52:52 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-16 21:52:52 +0300 |
commit | a5431a6dd0dc1d803bd7cfa2bbcb017d85d0999e (patch) | |
tree | 873249c7bf427fec21dba377a7f84caaec853e87 | |
parent | dd0238723a153646631ba0a8c2577d74fce61214 (diff) |
Use ERROR log level everywhere. Remove unused code from Reload plugin
48 files changed, 164 insertions, 113 deletions
diff --git a/plugins/checker/tests/configs/.rr-checker-init.yaml b/plugins/checker/tests/configs/.rr-checker-init.yaml index 5943551b..0aba90c5 100755 --- a/plugins/checker/tests/configs/.rr-checker-init.yaml +++ b/plugins/checker/tests/configs/.rr-checker-init.yaml @@ -13,7 +13,9 @@ server: status: address: "127.0.0.1:34333" - +logs: + mode: development + level: error http: debug: true address: 127.0.0.1:11933 diff --git a/plugins/checker/tests/plugin_test.go b/plugins/checker/tests/plugin_test.go index a37fc08e..02a7f953 100644 --- a/plugins/checker/tests/plugin_test.go +++ b/plugins/checker/tests/plugin_test.go @@ -25,7 +25,7 @@ import ( ) func TestStatusHttp(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -109,7 +109,7 @@ func checkHTTPStatus(t *testing.T) { } func TestStatusRPC(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ diff --git a/plugins/config/tests/config_test.go b/plugins/config/tests/config_test.go index 422e7eee..91ddc4ae 100755 --- a/plugins/config/tests/config_test.go +++ b/plugins/config/tests/config_test.go @@ -12,7 +12,7 @@ import ( ) func TestViperProvider_Init(t *testing.T) { - container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.DebugLevel)) + container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } diff --git a/plugins/gzip/tests/configs/.rr-http-middlewareNotExist.yaml b/plugins/gzip/tests/configs/.rr-http-middlewareNotExist.yaml index 3dc5f9df..08c9b0ff 100644 --- a/plugins/gzip/tests/configs/.rr-http-middlewareNotExist.yaml +++ b/plugins/gzip/tests/configs/.rr-http-middlewareNotExist.yaml @@ -19,4 +19,7 @@ http: numWorkers: 2 maxJobs: 0 allocateTimeout: 60s - destroyTimeout: 60s
\ No newline at end of file + destroyTimeout: 60s +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/gzip/tests/configs/.rr-http-withGzip.yaml b/plugins/gzip/tests/configs/.rr-http-withGzip.yaml index 38fdfe47..3475d5dd 100644 --- a/plugins/gzip/tests/configs/.rr-http-withGzip.yaml +++ b/plugins/gzip/tests/configs/.rr-http-withGzip.yaml @@ -19,4 +19,7 @@ http: numWorkers: 2 maxJobs: 0 allocateTimeout: 60s - destroyTimeout: 60s
\ No newline at end of file + destroyTimeout: 60s +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/gzip/tests/plugin_test.go b/plugins/gzip/tests/plugin_test.go index 39979895..97291ebe 100644 --- a/plugins/gzip/tests/plugin_test.go +++ b/plugins/gzip/tests/plugin_test.go @@ -21,7 +21,7 @@ import ( ) func TestGzipPlugin(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -102,7 +102,7 @@ func headerCheck(t *testing.T) { } func TestMiddlewareNotExist(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ diff --git a/plugins/headers/tests/configs/.rr-cors-headers.yaml b/plugins/headers/tests/configs/.rr-cors-headers.yaml index 5c1a200b..df985809 100644 --- a/plugins/headers/tests/configs/.rr-cors-headers.yaml +++ b/plugins/headers/tests/configs/.rr-cors-headers.yaml @@ -33,5 +33,7 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/headers/tests/configs/.rr-headers-init.yaml b/plugins/headers/tests/configs/.rr-headers-init.yaml index 252fe8f3..21a4373a 100644 --- a/plugins/headers/tests/configs/.rr-headers-init.yaml +++ b/plugins/headers/tests/configs/.rr-headers-init.yaml @@ -33,5 +33,7 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/headers/tests/configs/.rr-req-headers.yaml b/plugins/headers/tests/configs/.rr-req-headers.yaml index 9256e98d..bf305227 100644 --- a/plugins/headers/tests/configs/.rr-req-headers.yaml +++ b/plugins/headers/tests/configs/.rr-req-headers.yaml @@ -26,5 +26,7 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/headers/tests/configs/.rr-res-headers.yaml b/plugins/headers/tests/configs/.rr-res-headers.yaml index 1bca2c3d..ae354051 100644 --- a/plugins/headers/tests/configs/.rr-res-headers.yaml +++ b/plugins/headers/tests/configs/.rr-res-headers.yaml @@ -26,5 +26,7 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/headers/tests/headers_plugin_test.go b/plugins/headers/tests/headers_plugin_test.go index f1de8cb9..73aedb2c 100644 --- a/plugins/headers/tests/headers_plugin_test.go +++ b/plugins/headers/tests/headers_plugin_test.go @@ -20,7 +20,7 @@ import ( ) func TestHeadersInit(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -83,7 +83,7 @@ func TestHeadersInit(t *testing.T) { } func TestRequestHeaders(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -166,7 +166,7 @@ func reqHeaders(t *testing.T) { } func TestResponseHeaders(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -250,7 +250,7 @@ func resHeaders(t *testing.T) { } func TestCORSHeaders(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ diff --git a/plugins/http/tests/configs/.rr-broken-pipes.yaml b/plugins/http/tests/configs/.rr-broken-pipes.yaml index aacc303e..e57d0b86 100644 --- a/plugins/http/tests/configs/.rr-broken-pipes.yaml +++ b/plugins/http/tests/configs/.rr-broken-pipes.yaml @@ -24,6 +24,8 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-echoErr.yaml b/plugins/http/tests/configs/.rr-echoErr.yaml index 6ecdbb2a..24946c88 100644 --- a/plugins/http/tests/configs/.rr-echoErr.yaml +++ b/plugins/http/tests/configs/.rr-echoErr.yaml @@ -24,5 +24,7 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-env.yaml b/plugins/http/tests/configs/.rr-env.yaml index c9fdc798..e29f66cc 100644 --- a/plugins/http/tests/configs/.rr-env.yaml +++ b/plugins/http/tests/configs/.rr-env.yaml @@ -27,5 +27,7 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-fcgi-reqUri.yaml b/plugins/http/tests/configs/.rr-fcgi-reqUri.yaml index dbd19445..3009c30e 100644 --- a/plugins/http/tests/configs/.rr-fcgi-reqUri.yaml +++ b/plugins/http/tests/configs/.rr-fcgi-reqUri.yaml @@ -32,4 +32,7 @@ http: http2: enabled: false h2c: false - maxConcurrentStreams: 128
\ No newline at end of file + maxConcurrentStreams: 128 +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/configs/.rr-fcgi.yaml b/plugins/http/tests/configs/.rr-fcgi.yaml index 0cbd6d02..45b6dbd0 100644 --- a/plugins/http/tests/configs/.rr-fcgi.yaml +++ b/plugins/http/tests/configs/.rr-fcgi.yaml @@ -32,4 +32,7 @@ http: http2: enabled: false h2c: false - maxConcurrentStreams: 128
\ No newline at end of file + maxConcurrentStreams: 128 +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/configs/.rr-h2c.yaml b/plugins/http/tests/configs/.rr-h2c.yaml index d1b24338..cc42e3bf 100644 --- a/plugins/http/tests/configs/.rr-h2c.yaml +++ b/plugins/http/tests/configs/.rr-h2c.yaml @@ -23,4 +23,7 @@ http: http2: enabled: true h2c: true - maxConcurrentStreams: 128
\ No newline at end of file + maxConcurrentStreams: 128 +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/configs/.rr-http.yaml b/plugins/http/tests/configs/.rr-http.yaml index 7b91f735..c6868f8c 100644 --- a/plugins/http/tests/configs/.rr-http.yaml +++ b/plugins/http/tests/configs/.rr-http.yaml @@ -37,5 +37,8 @@ http: enabled: false h2c: false maxConcurrentStreams: 128 +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-init.yaml b/plugins/http/tests/configs/.rr-init.yaml index 50aa91ec..70b9642b 100644 --- a/plugins/http/tests/configs/.rr-init.yaml +++ b/plugins/http/tests/configs/.rr-init.yaml @@ -37,5 +37,7 @@ http: enabled: false h2c: false maxConcurrentStreams: 128 - +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-resetter.yaml b/plugins/http/tests/configs/.rr-resetter.yaml index b46b21f5..f2134812 100644 --- a/plugins/http/tests/configs/.rr-resetter.yaml +++ b/plugins/http/tests/configs/.rr-resetter.yaml @@ -24,5 +24,7 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-ssl-push.yaml b/plugins/http/tests/configs/.rr-ssl-push.yaml index 02de906a..3aea683c 100644 --- a/plugins/http/tests/configs/.rr-ssl-push.yaml +++ b/plugins/http/tests/configs/.rr-ssl-push.yaml @@ -26,4 +26,6 @@ http: redirect: true cert: fixtures/server.crt key: fixtures/server.key - # rootCa: root.crt
\ No newline at end of file +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/configs/.rr-ssl-redirect.yaml b/plugins/http/tests/configs/.rr-ssl-redirect.yaml index 0ba1753e..4d889734 100644 --- a/plugins/http/tests/configs/.rr-ssl-redirect.yaml +++ b/plugins/http/tests/configs/.rr-ssl-redirect.yaml @@ -26,4 +26,6 @@ http: redirect: true cert: fixtures/server.crt key: fixtures/server.key - # rootCa: root.crt
\ No newline at end of file +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/configs/.rr-ssl.yaml b/plugins/http/tests/configs/.rr-ssl.yaml index fb54d3fa..83b5a2dc 100644 --- a/plugins/http/tests/configs/.rr-ssl.yaml +++ b/plugins/http/tests/configs/.rr-ssl.yaml @@ -32,4 +32,7 @@ http: http2: enabled: false h2c: false - maxConcurrentStreams: 128
\ No newline at end of file + maxConcurrentStreams: 128 +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/http_test.go b/plugins/http/tests/http_test.go index f68cd42c..c8dd4b38 100644 --- a/plugins/http/tests/http_test.go +++ b/plugins/http/tests/http_test.go @@ -41,7 +41,7 @@ var sslClient = &http.Client{ } func TestHTTPInit(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -104,7 +104,7 @@ func TestHTTPInit(t *testing.T) { } func TestHTTPInformerReset(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -225,7 +225,7 @@ func informerTest(t *testing.T) { } func TestSSL(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -353,7 +353,7 @@ func fcgiEcho(t *testing.T) { } func TestSSLRedirect(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -439,7 +439,7 @@ func sslRedirect(t *testing.T) { } func TestSSLPushPipes(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -527,7 +527,7 @@ func sslPush(t *testing.T) { } func TestFastCGI_RequestUri(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -611,7 +611,7 @@ func fcgiReqURI(t *testing.T) { } func TestH2CUpgrade(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -700,7 +700,7 @@ func h2cUpgrade(t *testing.T) { } func TestH2C(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -788,7 +788,7 @@ func h2c(t *testing.T) { } func TestHttpMiddleware(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -887,7 +887,7 @@ func middleware(t *testing.T) { } func TestHttpEchoErr(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -977,7 +977,7 @@ func echoError(t *testing.T) { } func TestHttpEnvVariables(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -1061,7 +1061,7 @@ func envVarsTest(t *testing.T) { } func TestHttpBrokenPipes(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ diff --git a/plugins/informer/tests/.rr-informer.yaml b/plugins/informer/tests/.rr-informer.yaml index 83ecd582..266933fd 100644 --- a/plugins/informer/tests/.rr-informer.yaml +++ b/plugins/informer/tests/.rr-informer.yaml @@ -10,4 +10,7 @@ server: rpc: listen: tcp://127.0.0.1:6001 - disabled: false
\ No newline at end of file + disabled: false +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/informer/tests/informer_test.go b/plugins/informer/tests/informer_test.go index 9e21e7ea..193e84bb 100644 --- a/plugins/informer/tests/informer_test.go +++ b/plugins/informer/tests/informer_test.go @@ -21,7 +21,7 @@ import ( ) func TestInformerInit(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } diff --git a/plugins/metrics/tests/.rr-test.yaml b/plugins/metrics/tests/.rr-test.yaml index 79343e3c..37c50395 100644 --- a/plugins/metrics/tests/.rr-test.yaml +++ b/plugins/metrics/tests/.rr-test.yaml @@ -10,4 +10,7 @@ metrics: type: histogram help: "Custom application metric" labels: [ "type" ] - buckets: [ 0.1, 0.2, 0.3, 1.0 ]
\ No newline at end of file + buckets: [ 0.1, 0.2, 0.3, 1.0 ] +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/metrics/tests/metrics_test.go b/plugins/metrics/tests/metrics_test.go index 57b10aa4..2d3a3c27 100644 --- a/plugins/metrics/tests/metrics_test.go +++ b/plugins/metrics/tests/metrics_test.go @@ -45,7 +45,7 @@ func get() (string, error) { } func TestMetricsInit(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } @@ -107,7 +107,7 @@ func TestMetricsInit(t *testing.T) { } func TestMetricsGaugeCollector(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } @@ -174,7 +174,7 @@ func TestMetricsGaugeCollector(t *testing.T) { } func TestMetricsDifferentRPCCalls(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } diff --git a/plugins/reload/samefile.go b/plugins/reload/samefile.go deleted file mode 100644 index 80df0431..00000000 --- a/plugins/reload/samefile.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build !windows - -package reload - -import "os" - -func sameFile(fi1, fi2 os.FileInfo) bool { - return os.SameFile(fi1, fi2) -} diff --git a/plugins/reload/samefile_windows.go b/plugins/reload/samefile_windows.go deleted file mode 100644 index 5f70d327..00000000 --- a/plugins/reload/samefile_windows.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build windows - -package reload - -import "os" - -func sameFile(fi1, fi2 os.FileInfo) bool { - return fi1.ModTime() == fi2.ModTime() && - fi1.Size() == fi2.Size() && - fi1.Mode() == fi2.Mode() && - fi1.IsDir() == fi2.IsDir() -} diff --git a/plugins/reload/watcher.go b/plugins/reload/watcher.go index fff11f32..55e1d9d5 100644 --- a/plugins/reload/watcher.go +++ b/plugins/reload/watcher.go @@ -147,6 +147,7 @@ func ConvertIgnored(ignored []string) (map[string]struct{}, error) { // pass map from outside func (w *Watcher) retrieveFilesSingle(serviceName, path string) (map[string]os.FileInfo, error) { + const op = errors.Op("retrieve") stat, err := os.Stat(path) if err != nil { return nil, err @@ -340,29 +341,9 @@ func (w *Watcher) pollEvents(serviceName string, files map[string]os.FileInfo) { } } - // Check for renames and moves. - for path1 := range removes { - for path2 := range creates { - if sameFile(removes[path1], creates[path2]) { - e := Event{ - Path: path2, - Info: creates[path2], - service: serviceName, - } - - // remove initial path - delete(w.watcherConfigs[serviceName].Files, path1) - // update with new - w.watcherConfigs[serviceName].Files[path2] = creates[path2] - - w.log.Debug("file was renamed/moved", "old path", path1, "new path", path2, "name", creates[path2].Name(), "size", creates[path2].Size()) - w.Event <- e - } - } - } - // Send all the remaining create and remove events. for pth := range creates { + // add file to the plugin watch files w.watcherConfigs[serviceName].Files[pth] = creates[pth] w.log.Debug("file was added to watcher", "path", pth, "name", creates[pth].Name(), "size", creates[pth].Size()) @@ -374,6 +355,7 @@ func (w *Watcher) pollEvents(serviceName string, files map[string]os.FileInfo) { } for pth := range removes { + // delete path from the config delete(w.watcherConfigs[serviceName].Files, pth) w.log.Debug("file was removed from watcher", "path", pth, "name", removes[pth].Name(), "size", removes[pth].Size()) diff --git a/plugins/resetter/tests/.rr-resetter.yaml b/plugins/resetter/tests/.rr-resetter.yaml index 83ecd582..266933fd 100644 --- a/plugins/resetter/tests/.rr-resetter.yaml +++ b/plugins/resetter/tests/.rr-resetter.yaml @@ -10,4 +10,7 @@ server: rpc: listen: tcp://127.0.0.1:6001 - disabled: false
\ No newline at end of file + disabled: false +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/resetter/tests/resetter_test.go b/plugins/resetter/tests/resetter_test.go index 3bfccf47..45de67e3 100644 --- a/plugins/resetter/tests/resetter_test.go +++ b/plugins/resetter/tests/resetter_test.go @@ -20,7 +20,7 @@ import ( ) func TestResetterInit(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } diff --git a/plugins/rpc/tests/.rr-rpc-disabled.yaml b/plugins/rpc/tests/.rr-rpc-disabled.yaml index 624fb3c5..d5c185e7 100644 --- a/plugins/rpc/tests/.rr-rpc-disabled.yaml +++ b/plugins/rpc/tests/.rr-rpc-disabled.yaml @@ -1,3 +1,6 @@ rpc: listen: tcp://127.0.0.1:6001 - disabled: true
\ No newline at end of file + disabled: true +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/rpc/tests/.rr.yaml b/plugins/rpc/tests/.rr.yaml index 76e8b440..d2cb6c70 100644 --- a/plugins/rpc/tests/.rr.yaml +++ b/plugins/rpc/tests/.rr.yaml @@ -1,3 +1,6 @@ rpc: listen: tcp://127.0.0.1:6001 - disabled: false
\ No newline at end of file + disabled: false +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/rpc/tests/rpc_test.go b/plugins/rpc/tests/rpc_test.go index 88267dfb..0344da6b 100644 --- a/plugins/rpc/tests/rpc_test.go +++ b/plugins/rpc/tests/rpc_test.go @@ -17,7 +17,7 @@ import ( // graph https://bit.ly/3ensdNb func TestRpcInit(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } @@ -96,7 +96,7 @@ func TestRpcInit(t *testing.T) { // graph https://bit.ly/3ensdNb func TestRpcDisabled(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } diff --git a/plugins/server/tests/configs/.rr-no-app-section.yaml b/plugins/server/tests/configs/.rr-no-app-section.yaml index b6e3ea93..5266e83d 100644 --- a/plugins/server/tests/configs/.rr-no-app-section.yaml +++ b/plugins/server/tests/configs/.rr-no-app-section.yaml @@ -6,4 +6,7 @@ server: "RR_CONFIG": "/some/place/on/the/C134" "RR_CONFIG2": "C138" relay: "pipes" - relayTimeout: "20s"
\ No newline at end of file + relayTimeout: "20s" +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/server/tests/configs/.rr-sockets.yaml b/plugins/server/tests/configs/.rr-sockets.yaml index ab1239aa..6b5b6bf5 100644 --- a/plugins/server/tests/configs/.rr-sockets.yaml +++ b/plugins/server/tests/configs/.rr-sockets.yaml @@ -6,4 +6,7 @@ server: "RR_CONFIG": "/some/place/on/the/C134" "RR_CONFIG2": "C138" relay: "unix://unix.sock" - relayTimeout: "20s"
\ No newline at end of file + relayTimeout: "20s" +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/server/tests/configs/.rr-tcp.yaml b/plugins/server/tests/configs/.rr-tcp.yaml index f53bffcc..ee1d450a 100644 --- a/plugins/server/tests/configs/.rr-tcp.yaml +++ b/plugins/server/tests/configs/.rr-tcp.yaml @@ -6,4 +6,7 @@ server: "RR_CONFIG": "/some/place/on/the/C134" "RR_CONFIG2": "C138" relay: "tcp://localhost:9999" - relayTimeout: "20s"
\ No newline at end of file + relayTimeout: "20s" +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/server/tests/configs/.rr-wrong-command.yaml b/plugins/server/tests/configs/.rr-wrong-command.yaml index d2c087a6..e66349dd 100644 --- a/plugins/server/tests/configs/.rr-wrong-command.yaml +++ b/plugins/server/tests/configs/.rr-wrong-command.yaml @@ -7,3 +7,6 @@ server: "RR_CONFIG2": "C138" relay: "pipes" relayTimeout: "20s" +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/server/tests/configs/.rr-wrong-relay.yaml b/plugins/server/tests/configs/.rr-wrong-relay.yaml index 1dd73d73..98894c7a 100644 --- a/plugins/server/tests/configs/.rr-wrong-relay.yaml +++ b/plugins/server/tests/configs/.rr-wrong-relay.yaml @@ -6,4 +6,7 @@ server: "RR_CONFIG": "/some/place/on/the/C134" "RR_CONFIG2": "C138" relay: "pupes" - relayTimeout: "20s"
\ No newline at end of file + relayTimeout: "20s" +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/server/tests/configs/.rr.yaml b/plugins/server/tests/configs/.rr.yaml index b6e3ea93..5266e83d 100644 --- a/plugins/server/tests/configs/.rr.yaml +++ b/plugins/server/tests/configs/.rr.yaml @@ -6,4 +6,7 @@ server: "RR_CONFIG": "/some/place/on/the/C134" "RR_CONFIG2": "C138" relay: "pipes" - relayTimeout: "20s"
\ No newline at end of file + relayTimeout: "20s" +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/server/tests/server_test.go b/plugins/server/tests/server_test.go index bc374a9e..faf01b11 100644 --- a/plugins/server/tests/server_test.go +++ b/plugins/server/tests/server_test.go @@ -14,7 +14,7 @@ import ( ) func TestAppPipes(t *testing.T) { - container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.DebugLevel)) + container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } @@ -80,7 +80,7 @@ func TestAppPipes(t *testing.T) { } func TestAppSockets(t *testing.T) { - container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.DebugLevel)) + container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } @@ -146,7 +146,7 @@ func TestAppSockets(t *testing.T) { } func TestAppTCP(t *testing.T) { - container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.DebugLevel)) + container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } @@ -212,7 +212,7 @@ func TestAppTCP(t *testing.T) { } func TestAppWrongConfig(t *testing.T) { - container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.DebugLevel)) + container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } @@ -244,7 +244,7 @@ func TestAppWrongConfig(t *testing.T) { } func TestAppWrongRelay(t *testing.T) { - container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.DebugLevel)) + container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } @@ -280,7 +280,7 @@ func TestAppWrongRelay(t *testing.T) { } func TestAppWrongCommand(t *testing.T) { - container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.DebugLevel)) + container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } @@ -318,7 +318,7 @@ func TestAppWrongCommand(t *testing.T) { } func TestAppNoAppSectionInConfig(t *testing.T) { - container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.DebugLevel)) + container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.ErrorLevel)) if err != nil { t.Fatal(err) } diff --git a/plugins/static/tests/configs/.rr-http-static-disabled.yaml b/plugins/static/tests/configs/.rr-http-static-disabled.yaml index d0b9b388..e8917c06 100644 --- a/plugins/static/tests/configs/.rr-http-static-disabled.yaml +++ b/plugins/static/tests/configs/.rr-http-static-disabled.yaml @@ -27,4 +27,7 @@ http: numWorkers: 2 maxJobs: 0 allocateTimeout: 60s - destroyTimeout: 60s
\ No newline at end of file + destroyTimeout: 60s +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/static/tests/configs/.rr-http-static-files-disable.yaml b/plugins/static/tests/configs/.rr-http-static-files-disable.yaml index a3d814a3..1cae9ed7 100644 --- a/plugins/static/tests/configs/.rr-http-static-files-disable.yaml +++ b/plugins/static/tests/configs/.rr-http-static-files-disable.yaml @@ -27,4 +27,7 @@ http: numWorkers: 2 maxJobs: 0 allocateTimeout: 60s - destroyTimeout: 60s
\ No newline at end of file + destroyTimeout: 60s +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/static/tests/configs/.rr-http-static-files.yaml b/plugins/static/tests/configs/.rr-http-static-files.yaml index 35938b80..32d0a6c7 100644 --- a/plugins/static/tests/configs/.rr-http-static-files.yaml +++ b/plugins/static/tests/configs/.rr-http-static-files.yaml @@ -28,4 +28,7 @@ http: numWorkers: 2 maxJobs: 0 allocateTimeout: 60s - destroyTimeout: 60s
\ No newline at end of file + destroyTimeout: 60s +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/static/tests/configs/.rr-http-static.yaml b/plugins/static/tests/configs/.rr-http-static.yaml index 80a1fa7f..d3bd05f5 100644 --- a/plugins/static/tests/configs/.rr-http-static.yaml +++ b/plugins/static/tests/configs/.rr-http-static.yaml @@ -26,4 +26,7 @@ http: numWorkers: 2 maxJobs: 0 allocateTimeout: 60s - destroyTimeout: 60s
\ No newline at end of file + destroyTimeout: 60s +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/static/tests/static_plugin_test.go b/plugins/static/tests/static_plugin_test.go index 528d5eea..5bad54bf 100644 --- a/plugins/static/tests/static_plugin_test.go +++ b/plugins/static/tests/static_plugin_test.go @@ -25,7 +25,7 @@ import ( ) func TestStaticPlugin(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -133,7 +133,7 @@ func serveStaticSample(t *testing.T) { } func TestStaticDisabled(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -206,7 +206,7 @@ func staticDisabled(t *testing.T) { } func TestStaticFilesDisabled(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -282,7 +282,7 @@ func staticFilesDisabled(t *testing.T) { } func TestStaticFilesForbid(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ |