Commit Graph

356 Commits

Author SHA1 Message Date
Johannes Meyer
33696664cb
restore the stream format after writing the log prefix (#731)
* Fix MungeLine() for log lines that are longer than 5 characters
* Match order of log statements in logging_unittest.cc and logging_unittest.err
* Update logging_custom_prefix_unittest.cc and logging_custom_prefix_unittest.err to match logging_unittest.cc and logging_unittest.err
* Save the stream state and set the fill character before calling into a custom_prefix_callback
2021-11-05 22:29:36 +01:00
Marco Wang
c27c3a803b make LogCleaner support relative paths 2021-10-29 23:04:42 +02:00
Sergiu Deitsch
3362cc6c79 added log cleaner tests and fixed paths 2021-10-29 22:45:55 +02:00
Sergiu Deitsch
1398762db8 added mock log test 2021-10-12 14:36:33 +02:00
Sergiu Deitsch
4a55b11580 ci: added linux github workflow 2021-10-11 15:54:42 +02:00
huangqinjin
3965584721
support stack unwind on Android 2021-10-08 22:14:20 +02:00
Sergiu Deitsch
8474b7854b added gmock support 2021-10-07 19:53:08 +02:00
Sergiu Deitsch
f7407d4d27 export OS_* defines (fixes #715) 2021-10-01 11:26:07 +02:00
Tongliang Liao
2412db3158 raw_logging.h depends on type definition in logging.h.
Resolve https://github.com/google/glog/issues/712
2021-09-24 12:51:15 +02:00
kinsei0916
3b6b05d70b Use __EMSCRIPTEN__ instead of __USE_POSIX2 2021-09-20 22:14:58 +02:00
kinsei0916
de81bb0aac Fix link error for Emscripten 2021-09-20 22:14:58 +02:00
David Freese
ffb40018a5 Change size type in AnnotateBenignRaceSized to size_t from long
This makes this definition consistent with Abseil's declarations.  See:
https://github.com/abseil/abseil-cpp/blob/master/absl/base/dynamic_annotations.h#L213-L215

Having this unsigned seems to match what libsanitizers is expecting:
16e2427f50/libsanitizer/tsan/tsan_interface_ann.cpp (L367-L371)

This solves a "conflicting declaration of C function" when using glog
with abseil.
2021-09-03 09:51:46 -07:00
六岁小少年
df95749e83 Fix: not implement virtual class when WITH_CUSTOM_PREFIX on 2021-08-12 16:40:52 +08:00
Sebastian Hahn
9fce37c464 Add a static cast to compare unsigned with unsigned 2021-08-09 10:15:07 +02:00
Sergiu Deitsch
92cb3c449b fixed additional warnings 2021-08-01 17:12:21 +02:00
Sergiu Deitsch
0b83bb203d eliminate warnings 2021-07-22 22:52:22 +02:00
Sergiu Deitsch
717f569835 fixed exception specification mismatch 2021-07-14 19:37:05 +02:00
z-aki
4a4331f2f2 Fix syscall deprecation warning on macOS >= 10.12
Fix #185
2021-07-14 19:51:19 +05:30
Sergiu Deitsch
c39fcf6e8a ci: added more targets 2021-07-14 02:21:58 +02:00
Dmitriy A
a1374c4200 Implement LOG_EVERY_T.
Use <chrono> and <atomic> for C++11 or greater.
For non-Windows pre-C++11 systems, use <time.h> and built-in atomic operations.
For Windows pre-C++11, use the Windows implementations for time and atomic operations.
2021-07-05 07:25:12 -07:00
Sergiu Deitsch
d25a1b7bc0 cmake: export <atomic> availability (fixes #667) 2021-06-15 18:36:24 +02:00
Roman Gershman
86fea1ab25 Allow updating vmodule levels after vmodule was parsed, invalidate already cached site flags
vmodule flag is relevant for GNUC environments only.
2021-05-23 19:38:22 +03:00
Tongliang Liao
81e0d616ed Expose IsGoogleLoggingInitialized() in public API.
Usually library does not have control of the process lifespan.
Without this function, it is impossible to init/shutdown reliably.
It has been one of the major pain points for years when using glog in libraries.

AFAIK 3 workarounds have been used previously:
1. Init without checking. This causes compatiblity issues with other libs using glog.
2. Also provide a init function in library's API. This makes API complicated and stateful, especially for libs that does not mean to stay for the entire life of process.
3. Steal the utility function in internal namespace. Does not work with msvc (due to missing dllexport) or `gcc -fvisibility=hidden`.

None of them are perfect, except for the last hack that usually works well on Linux.
0.5.0 changes default visibility to hidden and it does not work anymore.

Resolve https://github.com/google/glog/issues/125
2021-05-14 08:57:32 +08:00
Sergiu Deitsch
0efaa59a75
Merge pull request #641 from sergiud/nullptr
CHECK support for nullptr (fixes #341)
2021-04-12 10:08:28 +02:00
Sergiu Deitsch
230da316c5
Merge pull request #637 from xiaobfly/master
fix LogCleaner::IsLogFromCurrentProject for filename_extension
2021-04-11 15:20:57 +02:00
Sergiu Deitsch
762a2a7ee1 eliminated gflags related linker warnings (#569) 2021-04-11 14:24:41 +02:00
Santiago Gil
0cbc235297 Add support for setting a custom prefix format 2021-04-09 20:11:44 +02:00
Bret McKee
c7656c3ec1 CHECK support for nullptr (fixes #341)
This allows CHECK_NE(foo, nullptr) to compile and produces "nullptr" for the
string representation of nullptr.
2021-04-09 20:10:08 +02:00
Sergiu Deitsch
663bb26960
Merge pull request #620 from sergiud/cmake-allow-to-disable-symbolize
cmake: allow to disable symbolize
2021-04-09 15:06:36 +02:00
Sergiu Deitsch
efc341d768 fixed windows builds 2021-04-08 18:16:42 +02:00
Sergiu Deitsch
39e83581de cmake: allow to disable symbolize 2021-04-07 22:59:46 +02:00
xiaobfly
635a078180 fix LogCleaner::IsLogFromCurrentProject for filename_extension 2021-04-07 17:42:52 +08:00
Sergiu Deitsch
7d60d6e04b removed windows specific headers 2021-04-06 19:59:47 +02:00
xiaobfly
4fca1b9673 fixed filename extension 2021-04-01 17:21:19 +08:00
Sergiu Deitsch
7f8a48b3bf
Merge pull request #595 from r-barnes/richard/ctr_type_fix
Change counter type to uint64
2021-03-31 09:43:14 +02:00
Richard Barnes
bf3e5a80ae Change counter type to uint64 2021-03-31 02:28:29 +02:00
Sergiu Deitsch
01f3e543e3 use C++ headers 2021-03-31 02:24:22 +02:00
Sergiu Deitsch
7a6e743eb6
Merge pull request #624 from sergiud/qualify-std-string
fully qualify std::string
2021-03-31 00:45:25 +02:00
Sergiu Deitsch
0b3c27d042 fully qualify std::string 2021-03-30 23:47:48 +02:00
Sergiu Deitsch
3533c22d21 handle --max_log_size overflow 2021-03-30 23:16:40 +02:00
Sergiu Deitsch
c30896d3d5 cmake: export symbols selectively 2021-03-30 21:41:52 +02:00
Marco
9881ea5969
Fix race conditions in LOG_EVERY_N (#492)
* Use CMakeLists.txt to check the availability of std::atomic<>
* Declare the static integer counters as std::atomic<int> instead of int if C++11's atomic is available
* implement fallback mechanism for pre C++11 compilers
* src/glog/logging.h.in: fix wrong atomic increment
* src/glog/logging.h.in: make modulo operations atomic
2021-02-22 22:17:25 +01:00
Sergiu Deitsch
795384957d replaced __CYGWIN32__ and __CYGWIN64__ by __CYGWIN__ 2021-02-13 14:52:26 +01:00
Sergiu Deitsch
4fa737b62a
Merge pull request #400 from guoyuhong/fixWebmailer
Fix logmailer problem for dynamic lib use of glog.
2021-02-13 11:57:07 +01:00
Sergiu Deitsch
4f09bed0b4
Merge pull request #263 from kennyyu/tsan_benign_race
Annotate LOG_EVERY_N macros as a benign race for TSAN
2021-02-13 11:55:42 +01:00
Sergiu Deitsch
7bba6030c2
Merge pull request #592 from aesophor/fix-logcleaner-file-ext
src/logging.cc: Make LogCleaner aware of filename extension (#589)
2021-02-13 11:48:23 +01:00
Sergiu Deitsch
7a8b66aa17
Merge pull request #593 from aesophor/fix-typo
src/logging.cc: Fix a typo in comment
2021-02-13 11:46:55 +01:00
Hill Ma
15d51a17cc Make stl_logging_unittest more robust. 2021-02-08 21:16:29 -08:00
Marco Wang
fe1287dd5d src/logging.cc: Fix a typo in comment
Signed-off-by: Marco Wang <m.aesophor@gmail.com>
2020-10-10 00:06:11 +08:00
Marco Wang
431d74c802 src/logging.cc: Make LogCleaner aware of filename extension (#589)
Previously, LogCleaner::IsLogFromCurrentProject() did not consider
the custom file extension set with SetLogFilenameExtension().

This PR fixes it.

Signed-off-by: Marco Wang <m.aesophor@gmail.com>
2020-10-09 22:40:12 +08:00