Skip to content

cmd/worker: migrate to lib/log

Administrator requested to merge worker-service-lib-log into main

Created by: bobheadxi

I confused myself again with all the different workers! I am spinning this off into a separate PR since I realized it is not related to https://github.com/sourcegraph/sourcegraph/pull/34155 . Closes https://github.com/sourcegraph/sourcegraph/issues/34321

This PR migrates the following to lib/log:

  • the Job interface
  • cmd/worker
  • enterprise/cmd/worker

The scope of this PR is to simply update the interface and use the loggers immediately where appropriate, to give a starting point for eventually migrating everything.

Many callsites use log15.Root() for internal/observation, which will be tackled in https://github.com/sourcegraph/sourcegraph/pull/34456

Test plan

sg start:

image

Empty attributes is slightly annoying, TBD if we should address - a potential workaround is detect in zapAdapter whether a first field is provided, and only add the Attributes namespace if so

Merge request reports

Loading