aboutsummaryrefslogtreecommitdiffstats
path: root/worker/worker.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-07-19 22:31:51 +0200
committerRobin Jarry <robin@jarry.cc>2022-07-23 22:52:15 +0200
commitcd1999555714fb886493d2d04b6c472be55cebef (patch)
tree1df3bcf5f687752db671d8bc9c7eab8a5c0fde71 /worker/worker.go
parenta1f779ccc9b16b22ad6cb2e0bf73c290fd0cc756 (diff)
downloadaerc-cd1999555714fb886493d2d04b6c472be55cebef.tar.gz
logging: use level-based logger functions
Do not pass logger objects around anymore. Shuffle some messages to make them consistent with the new logging API. Avoid using %v when a more specific verb exists for the argument types. The loggers are completely disabled (i.e. Sprintf is not even called) by default. They are only enabled when redirecting stdout to a file. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'worker/worker.go')
-rw-r--r--worker/worker.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/worker/worker.go b/worker/worker.go
index f65f0e3e..2af892c4 100644
--- a/worker/worker.go
+++ b/worker/worker.go
@@ -1,8 +1,6 @@
package worker
import (
- "fmt"
- "log"
"net/url"
"strings"
@@ -11,16 +9,15 @@ import (
)
// Guesses the appropriate worker type based on the given source string
-func NewWorker(source string, logger *log.Logger) (*types.Worker, error) {
+func NewWorker(source string) (*types.Worker, error) {
u, err := url.Parse(source)
if err != nil {
return nil, err
}
- worker := types.NewWorker(logger)
+ worker := types.NewWorker()
scheme := u.Scheme
if strings.ContainsRune(scheme, '+') {
scheme = scheme[:strings.IndexRune(scheme, '+')]
- fmt.Println(scheme)
}
backend, err := handlers.GetHandlerForScheme(scheme, worker)
if err != nil {