-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Comments
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. |
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
|
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. |
I'll close the issue since glog works as documented. |
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?
The text was updated successfully, but these errors were encountered: