Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

LogSink::ToString has no microsecond precision. #307

@bmahler

Description

@bmahler

I noticed a custom LogSink was logging without microsecond precision:

I0330 16:05:21.000000 21188 master.cpp:8832] ...
I0330 16:05:21.000000 21188 master.cpp:8832] ...
I0330 16:05:21.000000 21188 master.cpp:8832] ...

Currently LogSink::ToString always uses 0 for the microsecond component of the timestamp. There is a FIXME related to this:

  // FIXME(jrvb): Updating this to use the correct value for usecs
  // requires changing the signature for both this method and
  // LogSink::send().  This change needs to be done in a separate CL
  // so subclasses of LogSink can be updated at the same time.
  int usecs = 0;

https://github.com/google/glog/blob/v0.3.5/src/logging.cc#L1631-L1635

Per the FIXME, it looks like the only way to fix this is by updating the signature of LogSink::send. Any third party LogSink implementations would need to have their signature adjusted. Would such a PR be acceptable?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions