Skip to content

logging(gitstart): migrate internal/database to lib/log

Administrator requested to merge contractors/SG-36387 into main

Created by: gitstart-sourcegraph

Problem statement

internal/database is a shared library that still uses log15. We should migrate this package to use lib/log instead.

Success criteria

All 30 usages of log15 in internal/database are replaced with calls to an appropriately scoped lib/log logger.

https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Einternal/database+log15&patternType=literal

Implementation details

Callsites provide loggers to the package (no logger should be instantiated within the package)

  • In struct functions, all loggers should be set to the struct and provided.
  • In helper functions, all loggers should be provided as a parameter.

Time estimate

  • Pull requests with ~450 lines changed should take 48 hours at maximum. Ping the reviewer in the spec pull request if time-consuming changes are required.
  • Split the work into multiple pull requests if the total diff is bigger than 450 lines of code.

Refs

Sourcegraph Issue GitStart Issue

Test plan

  • A good way to test this PR is just to run the branch locally, and open the issue link, compare the changes on the PR and the listed issues. All of them must be fixed

Merge request reports

Loading