Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.
This repository was archived by the owner on Jan 7, 2022. It is now read-only.

Unified approach for printing a log id #25

@Zepheus

Description

@Zepheus

Log IDs are printed to the log in a huge number of different styles, making it hard to search. All of these occur:

  • log %lu
  • logid %lu
  • log_id %lu
  • Log %lu
  • Logid %lu
  • LogID %lu
  • log:%lu (no space)
  • log_:%lu
  • Log:%lu
  • log: %lu (with space)
  • Log: %lu
  • LogID: %lu
  • %lue%un%u (log ID with lsn, e.g. "42e420n1337")

Would be nice to codemod all of these to a single style, e.g. "log:%lu". We don't care which particular style wins, only that it be easily searchable.

  • Maybe add logid_to_string() similar to lsn_to_string()? That would be slower because of the allocation in std::string
  • Maybe have a macro similar to PRId64?
  • Add a lint rule for things like "log %lu", "log: %lu" etc?

Probably also unify the style of log+lsn, e.g. to "log:42-e420n1337".

Until then, here's a regex to search for log 42: [Ll]og_?([Ii][Dd])?:? ?42\b|\b42e

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions