In this release, glog underwent a major overhaul to take advantage of C++14 language and library features. Among the many changes, the public API has also been extended to use the more up-to-date standard library types (notably chrono).
glog aims to maintain source compatibility with the previous release. We did our best to ensure such compatibility in this version as well. However, downstream clients must recompile against the new glog version due to ABI incompatible changes.
Deprecations
A number of functions, methods, and types have been deprecated in favor of more uniform interface.
[!WARNING]
Deprecated methods will be removed in glog 0.8.0. Please make sure to update your code.
google::LogMessage::getMessageTime has been superseded by google::LogMessage::time.
google::LogMessageTime::timestamp has been superseded by google::LogMessageTime::when.
google::LogMessageTime::gmtoff has been superseded by google::LogMessageTime::gmtoffset.
google::EnableLogCleaner(unsigned) has been superseded by google::EnableLogCleaner(std::chrono::minutes).
google::LogSink::send accepting std::tm (deprecated since glog 0.6.0) has been superseded by google::LogSink::send to accept google::LogMessageTime instead.
google::LogMessageInfo and the custom prefix callback accepting this type have been superseded by google::LogMessage. To customize the log line prefix use the google::InstallPrefixFormatter function instead of the google::InitGoogleLogging overload.
Further changes
google::LogSeverity has been converted to an unscoped enum. This can result in compilation issues if implicit conversion between an int and google::LogSeverity was erroneously assumed.
By default, CMake no longer generates the undocumented and untested pkg-config files. The support is now opt in which requires the CMake option WITH_PKGCONFIG to be explicitly set to ON.
What's Changed
bazel: Use glog 0.6.0 in README. by @xiaoxq in https://github.com/google/glog/pull/831
Strip only the first leading @ in repo name by @meteorcloudy in https://github.com/google/glog/pull/832
fix: Fix warning about redefining STDC_HEADERS by @joeyparrish in https://github.com/google/glog/pull/835
support ndk r25 by @sergiud in https://github.com/google/glog/pull/844
added emscripten support by @sergiud in https://github.com/google/glog/pull/846
simplify DLOG macro definition in NDEBUG mode by @lstaroth in https://github.com/google/glog/pull/830
windows: call to FormatMessage() should _IGNORE_INSERTS by @anpol in https://github.com/google/glog/pull/849
log_file_header: add option to disable log file headers. by @anpol in https://github.com/google/glog/pull/850
SetLogger should delete previously set custom logger. by @anpol in https://github.com/google/glog/pull/853
logsink: fix multiple issues with LogSink::ToString() by @anpol in https://github.com/google/glog/pull/852
Fix broken stacktrace by @marekcirkos in https://github.com/google/glog/pull/851
Revert "simplify DLOG macro definition in NDEBUG mode" by @sergiud in https://github.com/google/glog/pull/855
Remove symbolize Bazel test by @drigz in https://github.com/google/glog/pull/860
Disable cc toolchain resolution when using Clang on Windows by @comius in https://github.com/google/glog/pull/863
Fix Windows clang CI for CC toolchain resolution by @jsharpe in https://github.com/google/glog/pull/877
ci: run linux workflow on ubuntu 22.04 by @sergiud in https://github.com/google/glog/pull/885
ci: update actions by @sergiud in https://github.com/google/glog/pull/886
fixed emscripten detection by @sergiud in https://github.com/google/glog/pull/897
drop lgtm badges by @sergiud in https://github.com/google/glog/pull/899
avoid anonymous struct typedefs by @sergiud in https://github.com/google/glog/pull/900
cmake: rename glogbase to glog_internal by @sergiud in https://github.com/google/glog/pull/901
drop custom prefix option by @sergiud in https://github.com/google/glog/pull/898
Adds fuzz testing for demangle by @catenacyber in https://github.com/google/glog/pull/878
[docs] Add Conan usage on README by @uilianries in https://github.com/google/glog/pull/862
ci: includ CIFuzz GitHub workflow by @catenacyber in https://github.com/google/glog/pull/903
Fix empty stack trace when use bazel on aarch64 by @noaxp in https://github.com/google/glog/pull/905
move to C++14 by @sergiud in https://github.com/google/glog/pull/902
Fixes for OpenBSD by @brad0 in https://github.com/google/glog/pull/921
New Contributors
@xiaoxq made their first contribution in https://github.com/google/glog/pull/831
@joeyparrish made their first contribution in https://github.com/google/glog/pull/835
@lstaroth made their first contribution in https://github.com/google/glog/pull/830
@marekcirkos made their first contribution in https://github.com/google/glog/pull/851
@comius made their first contribution in https://github.com/google/glog/pull/863
@jsharpe made their first contribution in https://github.com/google/glog/pull/877
@catenacyber made their first contribution in https://github.com/google/glog/pull/878
@uilianries made their first contribution in https://github.com/google/glog/pull/862
@noaxp made their first contribution in https://github.com/google/glog/pull/905
@brad0 made their first contribution in https://github.com/google/glog/pull/921
@mai93 made their first contribution in https://github.com/google/glog/pull/916
@Vertexwahn made their first contribution in https://github.com/google/glog/pull/919
@ekilmer made their first contribution in https://github.com/google/glog/pull/925
@pravinba9495 made their first contribution in https://github.com/google/glog/pull/946
@pateldeev made their first contribution in https://github.com/google/glog/pull/890
@bqhuyy made their first contribution in https://github.com/google/glog/pull/960
@dependabot made their first contribution in https://github.com/google/glog/pull/970
@lingbin made their first contribution in https://github.com/google/glog/pull/972
@vapier made their first contribution in https://github.com/google/glog/pull/985
@4c3y made their first contribution in https://github.com/google/glog/pull/986
@RISHIKREDDYL made their first contribution in https://github.com/google/glog/pull/1072
Full Changelog: https://github.com/google/glog/compare/v0.6.0...v0.7.0
Fix targets for layering_check by @mai93 in https://github.com/google/glog/pull/916
Fix spelling mistakes by @Vertexwahn in https://github.com/google/glog/pull/919
logging: Prevent LogStream constructor from being discarded by @ekilmer in https://github.com/google/glog/pull/925
Warn about dragons in the Bazel include path by @drigz in https://github.com/google/glog/pull/927
chore(docs): fix typo in conan install step in readme by @pravinba9495 in https://github.com/google/glog/pull/946
SendEmail: Protect users against vulnerable logmailers by @philwo in https://github.com/google/glog/pull/939
fix(demangle): prevent signed integer overflow by @sergiud in https://github.com/google/glog/pull/955
fix: address sanitizer failures by @sergiud in https://github.com/google/glog/pull/956
fix: stack buffer overflow by @sergiud in https://github.com/google/glog/pull/957
fix(demangle): limit recursion depth by @sergiud in https://github.com/google/glog/pull/958
fix(demangle): limit ParseTemplateArg recursion depth by @sergiud in https://github.com/google/glog/pull/963
fix: enable building without threads by @sergiud in https://github.com/google/glog/pull/964
ci: replace lcov by gcovr by @sergiud in https://github.com/google/glog/pull/965
Add tsan annotation to static variable when checking if vlog is on. by @pateldeev in https://github.com/google/glog/pull/890
ci: drop code scanning category by @sergiud in https://github.com/google/glog/pull/968
fix: remove stray spaces by @sergiud in https://github.com/google/glog/pull/967
fix: prefer includes in same directory by @sergiud in https://github.com/google/glog/pull/969
Support truncate log file for windows by @bqhuyy in https://github.com/google/glog/pull/960
build(deps): bump actions/checkout from 3 to 4 by @dependabot in https://github.com/google/glog/pull/970
fix(cmake): rework ucontext_t introspection by @sergiud in https://github.com/google/glog/pull/954
LogCleaner: Fix the scenario when FLAGS_log_dir has no '/' suffix by @lingbin in https://github.com/google/glog/pull/972
fix(build): raise minimum cmake version to 3.21 by @sergiud in https://github.com/google/glog/pull/974
fix: remove redundant POSIX function aliases by @sergiud in https://github.com/google/glog/pull/990
build(deps): bump github/codeql-action from 2 to 3 by @dependabot in https://github.com/google/glog/pull/988
build(deps): bump actions/upload-artifact from 3 to 4 by @dependabot in https://github.com/google/glog/pull/987
cmake: replace check_library_exists by check_cxx_symbol_exists by @sergiud in https://github.com/google/glog/pull/991
fix: log last error code instead of a BOOL by @sergiud in https://github.com/google/glog/pull/994
fix: replace NULL by nullptr by @sergiud in https://github.com/google/glog/pull/993
fix: drop custom (v)snprintf definition by @sergiud in https://github.com/google/glog/pull/992
symbolize_unittest: make it a bit more portable by @vapier in https://github.com/google/glog/pull/985
Added missing debug-logging macros by @4c3y in https://github.com/google/glog/pull/986
fix: shell quote user-provided mailer path by @sergiud in https://github.com/google/glog/pull/999
cmake: use threads import target by @sergiud in https://github.com/google/glog/pull/1000
cmake: do not enable TLS without threads by @sergiud in https://github.com/google/glog/pull/1001
cmake: remove obsolete check by @sergiud in https://github.com/google/glog/pull/1002
cmake: simplify symbol availability checks by @sergiud in https://github.com/google/glog/pull/1003
cmake: use glog specific project variables by @sergiud in https://github.com/google/glog/pull/1004
cmake: remove pre C++11 warning options by @sergiud in https://github.com/google/glog/pull/1005
fix: enable strip log tests by @sergiud in https://github.com/google/glog/pull/1009
rework public header structure by @sergiud in https://github.com/google/glog/pull/1012
fix: add missing gmtime_r check by @sergiud in https://github.com/google/glog/pull/1013
fix: remove unused test code by @sergiud in https://github.com/google/glog/pull/1014
feat: use standard mutexes by @sergiud in https://github.com/google/glog/pull/1015
feat: reduce manual deallocations by @sergiud in https://github.com/google/glog/pull/1016
fix(tests): prevent clang from optimizing new away by @sergiud in https://github.com/google/glog/pull/1017
fix(demangle): support decltype(nullptr) and pack expansion by @sergiud in https://github.com/google/glog/pull/1018
feat: use standard threads by @sergiud in https://github.com/google/glog/pull/1019
cmake: remove unused check by @sergiud in https://github.com/google/glog/pull/1021
feat: use chrono by @sergiud in https://github.com/google/glog/pull/1020
fix(demangle): place symbols in anonymous namespace by @sergiud in https://github.com/google/glog/pull/1022
feat(demangle): use cxx abi demangler by @sergiud in https://github.com/google/glog/pull/1023
fix: make log severity type safe by @sergiud in https://github.com/google/glog/pull/1025
feat: use standard atomics and call_once by @sergiud in https://github.com/google/glog/pull/1026
fix: cleanup exports by @sergiud in https://github.com/google/glog/pull/1029
feat: make headers self-contained by @sergiud in https://github.com/google/glog/pull/1030
ci(codecov): enable comments by @sergiud in https://github.com/google/glog/pull/966
fix: ensure export macro to be defined by @sergiud in https://github.com/google/glog/pull/1031
fix: remove unused declaration by @sergiud in https://github.com/google/glog/pull/1032
feat: make IsFailureSignalHandlerInstalled public by @sergiud in https://github.com/google/glog/pull/1033
fix: allow setting stderrthreshold using GLOG_stderrthreshold by @sergiud in https://github.com/google/glog/pull/1034
fix(debug): add missing parentheses in ternary expression by @sergiud in https://github.com/google/glog/pull/1035
fix: threads are always enabled by @sergiud in https://github.com/google/glog/pull/1036
cmake: determine when to use port.h by @sergiud in https://github.com/google/glog/pull/1037
feat(cleanup): use chrono by @sergiud in https://github.com/google/glog/pull/1038
feat(logger): use chrono by @sergiud in https://github.com/google/glog/pull/1039
feat(time): use tm::tm_gmtoff if present by @sergiud in https://github.com/google/glog/pull/1040
docs: cleanup by @sergiud in https://github.com/google/glog/pull/1041
fix: do not export g_logging_fail_func by @sergiud in https://github.com/google/glog/pull/1042
fix: reduce boilerplate code by @sergiud in https://github.com/google/glog/pull/1043
docs: describe default prefix format by @sergiud in https://github.com/google/glog/pull/1045
fix: reduce manual resource management by @sergiud in https://github.com/google/glog/pull/1046
fix(symbolize): simplify resource management by @sergiud in https://github.com/google/glog/pull/1047
fix(symbolize): cleanup by @sergiud in https://github.com/google/glog/pull/1048
feat: provide fallback for accessing process name by @sergiud in https://github.com/google/glog/pull/1049
fix: unify additional debug output by @sergiud in https://github.com/google/glog/pull/1050
feat(dbghelp): show source line number if present by @sergiud in https://github.com/google/glog/pull/1051
cmake: bump SOVERSION by @sergiud in https://github.com/google/glog/pull/1052
fix: move LogMessageVoidify into internal namespace by @sergiud in https://github.com/google/glog/pull/1053
cmake: replace check_function_exists by check_cxx_symbol_exists by @sergiud in https://github.com/google/glog/pull/1054
fix: better encapsulate internals by @sergiud in https://github.com/google/glog/pull/1055
fix(symbolize): use correct format specifier by @sergiud in https://github.com/google/glog/pull/1056
fix: unify LogMessage and LogMessageInfo by @sergiud in https://github.com/google/glog/pull/1057
cmake: rework elf detection by @sergiud in https://github.com/google/glog/pull/1058
Add MODULE.bazel file by @Vertexwahn in https://github.com/google/glog/pull/1059
build(deps): bump actions/cache from 3 to 4 by @dependabot in https://github.com/google/glog/pull/1064
ci(coverage): update to gcovr 7.0 by @sergiud in https://github.com/google/glog/pull/1070
Update README.rst by @RISHIKREDDYL in https://github.com/google/glog/pull/1072
feat: support failure functions that throw by @sergiud in https://github.com/google/glog/pull/1074
feat: allow to obtain the stack trace as a string by @sergiud in https://github.com/google/glog/pull/1075