Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log output inconsistent with other glog implementations #1108

Closed
gnoack opened this issue Jun 18, 2024 · 4 comments
Closed

Log output inconsistent with other glog implementations #1108

gnoack opened this issue Jun 18, 2024 · 4 comments
Labels

Comments

@gnoack
Copy link

gnoack commented Jun 18, 2024

In #530, the open source C++ glog package has switched its output format to include the year information on every line. While this is a useful feature in itself, it is now inconsistent with other implementations of glog-style output.

C++ glog is not the only library implementing this log format -- to get an impression of how widespread the format is, look for the phrase Log lines have this form:, which was copied around a few times as the informal spec:

https://github.com/search?q=%22Log+lines+have+this+form%3A%22&type=code

In particular, the Abseil.io implementation also writes the format without years:

https://github.com/abseil/abseil-cpp/blob/69195d5bd2416a7224416887c78353ee8edf67ee/absl/log/internal/log_format.cc#L175

What is the plan here?

@sergiud
Copy link
Collaborator

sergiud commented Jun 18, 2024

The plan for exactly what? I do not understand what are you asking. Note that glog does not claim to provide (strict) compatibility to other libraries.

@gnoack
Copy link
Author

gnoack commented Jun 20, 2024

Thank you for your answer!

The name "glog" made the impression to me that this was the C++ implementation of the "Google" log output format, as it is also implemented by the same-named implementation in Go1, and in line with the Abseil.io logging implementation2. (There is also one in Python3, but it is not a Google-released library.)

Spoken in practical terms, that means that the log files are created per program run (solving some aspects of log rotation), have a specific schema for their file name, and the log line format is standardized.

It is a surprise to me that you are not targeting compatibility with that, given that the library is hosted as "google/glog" on Github -- maybe this would be worth clarifying better in the README, possibly in coordination with the Abseil team, so that new users understand the differences better?

Footnotes

  1. https://github.com/golang/glog

  2. from https://abseil.io/about/:

    Abseil is an open source collection of C++ libraries drawn from the most fundamental pieces of Google’s internal codebase. These libraries are the nuts-and-bolts that underpin almost everything Google runs.

  3. https://github.com/benley/python-glog

@sergiud
Copy link
Collaborator

sergiud commented Jun 20, 2024

You are correct that google/glog indeed hosts the original implementation of glog now maintained by community. AFAIK Google abandoned the project in favor of logging implementation in Abseil. The log format, however, was never standardized or at least I'm not aware of such undertaking, which is why it was extended in glog over time to better fit the users' needs. I also believe it is very clear that Abseil log and glog are two different and independent projects (the former being a fork of the latter) and they will further diverge over time.

It is important to note that users can write their own prefix formatters in glog and restore the "original" prefix if necessary.

Given these circumstances, I'm not sure what exactly needs to be clarified. In case you have a specific idea in mind, you are welcome to submit a PR with corresponding changes.

@sergiud sergiud added the wontfix label Jul 5, 2024
@sergiud
Copy link
Collaborator

sergiud commented Jul 5, 2024

I'll close the issue since glog works as documented.

@sergiud sergiud closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants