Commit Graph

737 Commits

Author SHA1 Message Date
Sergiu Deitsch
af8344bbbe
cmake: rename glogbase to glog_internal (#901) 2023-02-24 20:39:46 +01:00
Sergiu Deitsch
88e2cd4eef
avoid anonymous struct typedefs (#900) 2023-02-24 20:15:03 +01:00
Sergiu Deitsch
4ffb2f3c40
drop lgtm badges (#899) 2023-02-24 20:13:38 +01:00
Sergiu Deitsch
4056374800
fixed emscripten detection (#897) 2023-02-24 19:25:26 +01:00
Sergiu Deitsch
f545ff5e7d
ci: update actions (#886) 2023-01-01 18:30:33 +01:00
Sergiu Deitsch
2115d9b590
ci: run linux workflow on ubuntu 22.04 (#885) 2023-01-01 18:08:53 +01:00
James Sharpe
c18db3903b Fix Windows clang CI for CC toolchain resolution
Select the correct toolchain and platform for
building with clang on windows with CC toolchain
resolution active.
2022-11-30 10:37:01 +01:00
Ivo List
05fbc65278 Disable cc toolchain resolution when using Clang on Windows
Different compilers on Window are not yet supported with CC toolchain resolution.
2022-09-21 17:00:02 +02:00
Rodrigo Queiro
9ad08ac6cc Remove symbolize Bazel test
It is broken on Windows CI (#859) in a way that I don't understand.
2022-09-15 16:42:46 +02:00
Sergiu Deitsch
b70ea80433
Revert "simplify DLOG macro definition in NDEBUG mode (#830)" (#855)
This reverts commit 278ed96891.
2022-08-18 16:14:23 +02:00
Marek Cirkos
bfee415a1d
bazel: fix broken stacktrace (#851)
Since #846, `HAVE_UNWIND_H`  is not really in use. Instead we should use `HAVE__UNWIND_BACKTRACE` and `HAVE__UNWIND_GETIP` (added in #846). To prevent that from happening again, also added Bazel tests that confirm stacktrace are still working.
2022-08-16 18:48:59 +02:00
Andrei Polushin
acc60d0c38
logsink: fix multiple issues with LogSink::ToString() (#852)
1. Initializing std::ostringstream with a string makes no sense, as the
   string becomes an initial value of an underlying buffer; seek-to-end
   is not performed, so the initial value gets completely overwritten by
   subsequent writing.

2. Flag `log_year_in_prefix` should be considered, as if formatting a
   regular logging message.

3. Writing a buffer to std::ostream is better expressed with write(s,n).
2022-08-13 12:21:25 +02:00
Andrei Polushin
6d5b384507
SetLogger should delete previously set custom logger. (#853)
As specified in the doc comment for SetLogger, "the logger becomes the
property of the logging module and should not be deleted by the caller".

Not only should the LogDestination delete a custom logger in its
destructor, but it should also delete a previous logger when another
logger is passed to SetLogger().

Co-authored-by: Sergiu Deitsch <sergiud@users.noreply.github.com>
2022-08-13 12:20:33 +02:00
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
Andrei Polushin
a1b6164ef1
windows: call to FormatMessage() should _IGNORE_INSERTS (#849)
Calling FormatMessage without a FORMAT_MESSAGE_IGNORE_INSERTS flag could
cause trouble, as explained in an article by Raymond Chen:

* The importance of the FORMAT_MESSAGE_IGNORE_INSERTS flag
  https://devblogs.microsoft.com/oldnewthing/20071128-00/?p=24353
2022-08-12 15:18:55 +02:00
rain
278ed96891
simplify DLOG macro definition in NDEBUG mode (#830)
Co-authored-by: joliph <joliphzjf@gmail.com>
Co-authored-by: Sergiu Deitsch <sergiud@users.noreply.github.com>
2022-08-06 20:33:23 +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
Joey Parrish
c515e1ae2f
remove unused STDC_HEADERS definition (#835) 2022-07-02 01:03:18 +02:00
Yun Peng
79d692c645 Strip only the first leading @
This change is needed for glog to work with future version of Bazel when
canonical label literals is used in Bzlmod.

Context: https://docs.google.com/document/d/1N81qfCa8oskCk5LqTW-LNthy6EBrDot7bdUsjz6JFC4/edit#heading=h.5mcn15i0e1ch
2022-06-15 18:05:23 +02:00
Xiangquan Xiao
086ce224d2 bazel: Use glog 0.6.0 in README. 2022-06-13 12:53:24 +02:00
Sergiu Deitsch
b33e3bad4c
Merge pull request #812 from google/release-0.6
release 0.6
2022-04-05 00:03:27 +02:00
Sergiu Deitsch
54b8bcbbf1 release 0.6 2022-04-02 20:33:57 +02:00
Sergiu Deitsch
864ef64920
Merge pull request #801 from skeptic-monkey/master
Fix namespace resolution issue in LOG_EVERY_T
2022-03-16 15:51:09 +01:00
Luc Bertrand
c640c2f7c1 Fix namespace resolution issue in LOG_EVERY_T 2022-03-16 15:27:38 +01:00
Rodrigo Queiro
5addeedc0a Fix "'GLOG_EXPORT' macro redefined" on clang-cl
The previous approach used
--incompatible_enable_cc_toolchain_resolution, which is recommended by
the docs, but a Bazel developer told me it's obsolete. The new, old
approach is simpler and should stop the warning from being user-visible.
2022-03-08 13:39:50 +01:00
Rodrigo Queiro
d153e294b8 Avoid "GLOG_EXPORT macro redefined" in clang-cl CI
I would prefer to fix this in glog.bzl but couldn't get that to work.
2022-03-04 11:12:21 +01:00
Rodrigo Queiro
c4ca519a86 Add CI job for clang-cl on Windows
This should catch issues like #801. This uses the new `tasks` syntax to
define multiple Windows tasks:

https://github.com/bazelbuild/continuous-integration/blob/master/buildkite/README.md#basic-syntax
2022-03-04 11:12:21 +01:00
Sergiu Deitsch
a8e0007e96
Merge pull request #790 from git-hulk/feature/logs-to-stdout
Add the logtostdout and colorlogtostdout flag to allow logging to stdout
2022-02-20 12:32:06 +01:00
Sergiu Deitsch
553ddaea85
Merge pull request #794 from Arfrever/tests-TMPDIR
Tests: Respect TEST_TMPDIR, TMPDIR, TMP environmental variables
2022-02-20 12:31:06 +01:00
Arfrever Frehtes Taifersar Arahesis
6d3f70a405 Pass EXIT_SUCCESS or EXIT_FAILURE to exit() and _exit() 2022-02-19 20:07:23 +01:00
Arfrever Frehtes Taifersar Arahesis
612a7d28c1 Tests: Respect TEST_TMPDIR, TMPDIR, TMP environmental variables
Use GetExistingTempDirectories() (which uses GetTempDirectories() which respects
TEST_TMPDIR, TMPDIR, TMP environmental variables) for FLAGS_test_tmpdir variable
used in some tests.

Fixes: #793
2022-02-19 20:07:23 +01: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
Arfrever Frehtes Taifersar Arahesis
b38ed9d08a cmake_package_config_generate: Fix CMake warnings with CMake 3.23
Correct syntax to run CMake built-in command-line tools is `cmake -E`:
https://cmake.org/cmake/help/v3.23/manual/cmake.1.html#run-a-command-line-tool

This test was mistakenly using `cmake env ... cmake ...`, where `env` and second `cmake`
were interpreted as paths (of source directory or build directory), resulting
in "Ignoring extra path from command line" CMake warnings with CMake 3.23:
eacf1f879b
2022-02-18 14:15:15 +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
Sergiu Deitsch
aa94e6b9ab simplify flags export 2022-02-13 13:04:24 +01:00
Sergiu Deitsch
17269d649d cmake: enable custom prefix by default 2022-02-13 12:54:11 +01:00
Arfrever Frehtes Taifersar Arahesis
bc1fada1cf libglog.pc: Set Libs.private for static linking 2022-01-25 19:35:57 +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
Vijaymahantesh Sattigeri
6969412183 Changed my Email ID 2022-01-19 21:50:30 +01:00
Sergiu Deitsch
6434410145 cmake: require at least gflags 2.2.2 2022-01-11 17:48:32 +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
224f66bb63 cmake: do not search for platform specific unwind
This change removes platform specific unwind lookup allowing the use of
LLVM unwind implementation.
2021-12-22 16:15:15 +01:00
Sergiu Deitsch
4ffa98388f ensure _Unwind_Backtrace to actually be available 2021-12-21 11:38:12 +01:00
Sergiu Deitsch
087ad5bf32 eliminated clang warnings 2021-12-21 11:37:49 +01:00
Sergiu Deitsch
9dc1107f88 run clang-tidy 2021-12-15 12:04:34 +01:00