Commit Graph

120 Commits

Author SHA1 Message Date
Andrei Polushin
1fb4cc1958
log_file_header: add option to disable log file headers. (#850)
Log lines can be customized for parsing by an external tool.

To simplify such customization and parsing, there should be an option to
customize the file header, or at least to disable adding it.
2022-08-13 11:10:00 +02:00
Sergiu Deitsch
6ed0c9e58b
added emscripten support (#846) 2022-08-04 22:52:47 +02:00
Sergiu Deitsch
a34226ca94
support ndk r25 (#844) 2022-08-01 10:46:35 +02:00
git-hulk
180b700ddc Add logtostdout and colorlogtostdout flags for logging to stdout
Currently, glog allows to use of logtostderr to send error logs to
stderr, but many log tailers would regard logs from stderr as error
logs. So we want to send non-error logs to stdout and only send error
logs to stderr according to the stderrthreshold.
2022-02-19 16:13:59 +01:00
Sergiu Deitsch
9f0b7d3bfe renamed GOOGLE_GLOG_DLL_DECL to GLOG_EXPORT
Use a consistent naming and avoid platform specific terms. Also remove
copy and paste code.
2022-02-14 10:32:44 +01:00
chien-hsing.wu
18836106d1 LogCleaner: avoid scanning logs too frequently 2022-01-25 13:45:59 +01:00
Frank Kolarek
b0174b3dda On Solaris, uname() returns non-negative value
As per https://docs.oracle.com/cd/E18752_01/html/816-5167/uname-2.html#REFMAN2uname-2
Solaris version of uname() return a non-negative value on success. Modifying this code to check
for a return value of less than zero will work on Solaris as well as Linux and AIX.
2022-01-19 21:51:06 +01:00
Andrei Polushin
a8cfbe0c0c stdcxx: eliminate excessive use of std::string::c_str()
It could be more clear and slightly more efficient not to convert an
`std::string` into a C-style string whenever possible.
2021-12-30 12:55:45 +01:00
Sergiu Deitsch
b3abfaa123 use uint32 for --max-log-size 2021-12-29 23:15:17 +01:00
M Samoila
43fc3bf91c Add log_year_in_prefix flag
The flag allows suppressing the year in the log line prefix. At the same
time, the flag allows to generate log output compatible to glog releases
prior to version 0.5.
2021-12-23 21:43:23 +01:00
Sergiu Deitsch
42d509b1c3 revert to int atomics 2021-12-23 17:41:29 +01:00
Sergiu Deitsch
9dc1107f88 run clang-tidy 2021-12-15 12:04:34 +01:00
Sergiu Deitsch
dfb9ffc324 provide backward compatible send overload 2021-12-15 11:14:23 +01:00
Marco Wang
d09b999f34 LogCleaner: make overdue_days_ unsigned int
Since the value of `LogCleaner::overdue_days_` should be >= 0,
we can simply make it an unsigned int which also avoids
unnecessary assertions.

Signed-off-by: Marco Wang <m.aesophor@gmail.com>
2021-12-13 19:00:07 +01:00
Marco Wang
ccbda2dfd5 LogCleaner: Fix relative paths and add a new test
Signed-off-by: Marco Wang <m.aesophor@gmail.com>
2021-12-09 10:30:51 +01:00
Vijaymahantesh Sattigeri
ef36f800ed Added an API to get GMT offset from LogMessageTime
* Added API to get GMT offset
    * Made LogMessageTime as a memeber of LogMessage
    * Refactored LogSink::send() method
2021-12-09 10:26:47 +01:00
Sergiu Deitsch
65199ed0b8 protect VLOG by use_logging 2021-11-18 00:01:33 +01:00
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
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
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
Sergiu Deitsch
0b83bb203d eliminate warnings 2021-07-22 22:52:22 +02:00
Sergiu Deitsch
c39fcf6e8a ci: added more targets 2021-07-14 02:21:58 +02: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
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
xiaobfly
635a078180 fix LogCleaner::IsLogFromCurrentProject for filename_extension 2021-04-07 17:42:52 +08: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
3533c22d21 handle --max_log_size overflow 2021-03-30 23:16:40 +02: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
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
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
Marco
d82641f709
Merge branch 'master' into encapsulate-log-cleaner 2020-10-03 09:52:23 +08:00
Yuhong Guo
b55437ac10 Fix logmailer problem for dynamic lib. 2020-10-03 01:01:05 +02:00
Sergiu Deitsch
f28ae960c3
Merge pull request #573 from msamoila/msamoila-use-utc-time
Add FLAGS_log_utc_time; when 'true' the time will be written in log in UTC, resolves #571
2020-09-29 22:25:02 +02:00
Sergiu Deitsch
fa0d50f9fc
Merge pull request #570 from jiuqiant/patch-1
Connect glog to Andorid logging API
2020-09-29 22:22:12 +02:00
Sergiu Deitsch
40ab822812
Merge pull request #438 from d-uspenskiy/master
Add extra information in log file header (application build/version, actual duration time)
2020-09-29 22:18:24 +02:00
Sergiu Deitsch
8ee2bb5b31
Merge pull request #553 from huangqinjin/android
Output to logcat on Android
2020-09-29 22:11:54 +02:00
M Samoila
909069ea82 Add FLAGS_log_utc_time; when 'true' the time will be written in log in UTC 2020-09-01 10:55:53 -07:00
Jiuqiang Tang
64650ef2ed
Connect glog to Andorid logging API
In LogMessage::Flush(), write to __android_log_write() so that the messages can be seen via "adb logcat".

This is already a patch in the Google MediaPipe's repo: https://github.com/google/mediapipe/blob/master/third_party/com_github_glog_glog_9779e5ea6ef59562b030248947f787d1256132ae.diff.
2020-08-21 20:24:00 -07:00