Commit Graph

453 Commits

Author SHA1 Message Date
Sergiu Deitsch
9a43cfb8d2 install unwind find module alongside glog 2019-11-10 11:09:18 +01:00
Sergiu Deitsch
19570c69c9 renamed and cleaned up the unwind find module 2019-11-10 11:09:14 +01:00
Vyacheslav Yurkov
742fe94f22 Use libunwind as an imported target
When UNWIND_LIBRARY is used directly as a public dependency then
absolute path is stored in cmake config file. This is an issue when
glog is used as part of an SDK, which was built somewhere else. When
SDK is installed on developer's machine, cmake config contains a full
path to non-existent location. The solution is to find libunwind
during configure stage and store target name as a dependency, not a full path.
Cmake module looks for libunwind and libunwind-PLAT, where PLAT is one of
supported platforms.

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
2019-11-02 02:42:25 +01:00
Sergiu Deitsch
fd3dc2c633
Merge pull request #484 from sergiud/remove-executable-flag
removed executable flag from .cmake file
2019-11-02 01:53:12 +01:00
Sergiu Deitsch
eec1435d52 removed executable flag from .cmake file 2019-11-02 00:20:22 +01:00
Sergiu Deitsch
e227697b0b
Merge pull request #483 from loop0day/enhance
Support pkg-config
2019-11-01 16:33:05 +01:00
loop0day
82d0860b76 Support pkg-config 2019-11-01 22:28:58 +08:00
Sergiu Deitsch
e0a2521e3d
Merge pull request #482 from google/revert-19-master
Revert "Added fixed log name support"
2019-11-01 13:26:53 +01:00
Marco
a6f7be14c6 Add support for automatic removal of old logs (#432)
* Add support for automatic removal of old logs

GetOverdueLogNames(string log_directory, int days) will check all
filenames under log_directory, and return a list of files whose last modified time is
over the given days (calculated using difftime()).

So that we can easily for unlink all files stored in the returned vector.

* Replaced the lines that require C++11

* embed dirent.h in project

* Add support for automatic removal of old logs

In this commit, at the end of LogFileObject::Write,
it will perform clean up for old logs.

It uses GetLoggingDirectories() and for each file in each
directory, it will check if a file is a log file produced by glog.
If it is, and it is last modified 3 days ago, then it will unlink()
this file. (It will only remove the project's own log files,
it won't remove the logs from other projects.)

Currently it is hardcoded to 3 days, I'll see if this can be
implemented in a more flexible manner.

* Implement old log cleaner

The log cleaner can be enabled and disabled at any given time.
By default, the log cleaner is disabled.

For example, this will enable the log cleaner and delete
the log files whose last modified time is >= x days
google::EnableLogCleaner(x days);

To disable it, simply call
google::DisableLogCleaner();

Please note that it will only clean up the logs produced for
its own project, the log files from other project will be untouched.

* logging: log_cleaner: Use blackslash for windows dir delim

* logging: log_cleaner: remove the range-based loops

Also replaced the hardcoded overdue days with the correct variable.

* Add Marco Wang to AUTHORS and CONTRIBUTORS

* logging: log_cleaner: Remove redundant filename stripping

Previously the full path to a file is passed into IsGlogLog(),
and then std::string::erase() is used to get the filename part.
If a directory name contains '.', then this function will be unreliable.

Now only the filename it self is passed into IsGlogLog(),
so this problem will be eradicated.

* logging: log_cleaner: improve readability

* Add google::EnableLogCleaner() to windows logging.h

* logging: log_cleaner: Remove perror message

* logging: IsGlogLog: match filename keyword by keyword

Splitting a filename into tokens by '.' causes problems
if the executable's filename contains a dot.

Filename should be matched keyword by keyword in the following
order:
1. program name
2. hostname
3. username
4. "log"
2019-11-01 12:20:11 +01:00
Sergiu Deitsch
15fb5ca5b6
Revert "Added fixed log name support" 2019-11-01 12:01:41 +01:00
Sergiu Deitsch
5792d60d68
Merge pull request #441 from asekretenko/useconds
Extend the LogSink interface to be able to pass microseconds
2019-10-31 23:43:50 +01:00
Sergiu Deitsch
44f6079fad
Merge pull request #19 from ezegomez/master
Added fixed log name support
2019-10-31 23:40:55 +01:00
Sergiu Deitsch
242130d305
Merge pull request #350 from TheModMaker/fixIosSim
Allow getpwuid_r to return missing entry.
2019-10-31 23:00:31 +01:00
Sergiu Deitsch
1a4c47a749
Merge pull request #88 from kekstee/master
Respect configured docdir
2019-10-31 22:56:05 +01:00
Sergiu Deitsch
f17d11aa8c
Merge pull request #161 from mpercy/thread-local-libunwind-2
Use thread local for libunwind GetStackTrace() reentrancy protection
2019-10-31 22:54:34 +01:00
Sergiu Deitsch
1227cf4dab
Merge pull request #312 from ruslo/pr.api21
Fix build for Android API < 21
2019-10-31 22:52:04 +01:00
Sergiu Deitsch
0f83e53c43
Merge pull request #443 from ammubhave/fix_musl_build
Fix symbolize_unittest for musl builds
2019-10-31 22:45:26 +01:00
Sergiu Deitsch
e558d50b0a
Merge pull request #370 from hemantbits/patch-1
Fix warnings
2019-10-31 22:44:48 +01:00
Sergiu Deitsch
30f7f3ee93
Merge pull request #479 from neheb/patch-2
logging: Fix compilation with uClibc++
2019-10-31 22:42:13 +01:00
Sergiu Deitsch
6f5699a236
Merge pull request #460 from neheb/patch-1
googletest: Switch to nanosleep
2019-10-31 22:41:36 +01:00
Rosen Penev
e24276a35e
logging: Fix compilation with uClibc++
uClibc++ has compiler support for C++11, but not the functions.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-10-31 13:04:29 -07:00
Rosen Penev
1d762fa5b0
googletest: Switch to nanosleep
usleep is deprecated and optionally not available with uClibc-ng.
2019-10-31 13:00:48 -07:00
Sergiu Deitsch
1655f4f910
Merge pull request #475 from ffontaine/master
src/symbolize.cc: fix build without dlfcn.h
2019-10-31 19:11:56 +01:00
Fabrice Fontaine
10498b485f src/symbolize.cc: fix build without dlfcn.h
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-10-29 22:12:39 +01:00
Shinichiro Hamaji
4cc89c9e2b
Merge pull request #465 from durswd/support_clang-cl
I supported clang-cl with BUILD_SHARED_LIBS
2019-09-02 21:16:42 -07:00
durswd
a8fad525e5 Changed the order of conditions 2019-09-02 13:28:18 +09:00
durswd
00cb9f4e6f I supported clang-cl with BUILD_SHARED_LIBS 2019-09-02 12:32:29 +09:00
Fumitoshi Ukai
ba8a9f6952
fix typo: TOOD -> TODO (#448) 2019-05-07 16:02:06 +09:00
Philipp Wollermann
0d0c254317 Don't test on Ubuntu 14.04 (#446)
Ubuntu 14.04 is about to be end-of-life and Bazel CI will stop supporting it shortly afterwards.

Context: https://groups.google.com/d/msg/bazel-dev/_D6XzfNkQQE/8TNKiNmsCAAJ
2019-04-24 10:48:51 +09:00
Shuhei Takahashi
6ca3d3cf58 Fix stacktrace on bazel build. (#347)
We need at least following defs to be set to print stacktrace in
failure signal handler.

- HAVE_UNWIND_H: on Linux and macOS. unwind.h is usually present
  by default on those OSes.
- HAVE_DLADDR: on macOS.

Windows is not cared because glog can not be built with bazel
on Windows today.
2019-04-12 10:09:41 +09:00
Amol Bhave
834dd780bf Fix symbolize_unittest for musl builds
When glog 0.4.0 is built using musl instead of glibc, the compilation
for this test fails because musl doesn't provide execinfo.h, which sets
HAVE_STACKTRACE to false.

Tested by building glog with musl and verifying that the build succeeds
with this patch. [See https://github.com/openwrt/packages/pull/8583]

Signed-off-by: Amol Bhave <ambhave@fb.com>
2019-04-03 12:08:35 -07:00
Andrei Sekretenko
94a54120de Extended the LogSink interface to be able to pass microseconds. 2019-03-27 18:27:31 +01:00
Shinichiro Hamaji
96a2f23dca
Merge pull request #419 from shinh/release-0-4-0
Release 0.4.0
2019-03-22 11:51:46 +09:00
Shinichiro Hamaji
5c576f78c4
Merge pull request #431 from romkatv/disallow_prefix
Protect macros from user code to the left of them
2019-02-18 11:49:24 +09:00
romkatv
29dd5da60f Add Roman Perepelitsa to AUTHORS and CONTRIBUTORS 2019-02-16 19:31:50 +01:00
romkatv
4db0631346 Protect macros from user code to the left of them 2019-02-16 19:23:36 +01:00
Shinichiro Hamaji
460ec1f564 Merge branch 'master' into release-0-4-0 2019-02-14 17:46:12 +09:00
Shinichiro Hamaji
41f4bf9cbc
Merge pull request #425 from plmuon/remove-time-from-raw-logging
remove time from raw logging
2019-02-02 11:00:29 +09:00
Shinichiro Hamaji
64041397b3 Use static to define CheckStackTrace on non-GNU (#429)
for `&CheckStackAddress`, VisualStudio emits address of a trampoline like PLT, 
not the actual address of `CheckStackTrace`.

We need address of `CheckStackTrace` to guess the address range of the function.
`static` function seems to return the actual address of the function.

Fixes #421
2019-02-02 10:13:43 +09:00
Shinichiro Hamaji
7f91846ca1 Stop using auto_ptr (#428)
Stop using auto_ptr

std::unique_ptr requires -std=c++11. just use raw pointer.
2019-02-01 17:35:02 +09:00
Peter Mutsaers
e5588de96d remove time from raw logging 2019-01-29 23:38:03 +01:00
Fumitoshi Ukai
7ffca211fe
fix appveyor link (#424)
project/google/glog -> project/google-admin/glog
2019-01-28 14:06:21 +09:00
Shinichiro Hamaji
ed1ef7c4db Apply #397 to glog/logging.h.in
windows/glog/logging.h is expected to be generated by
src/windows/preprocess.sh and should not be modified directly.
2019-01-24 09:25:43 +09:00
Sergiu Deitsch
1431a17f37
Merge pull request #420 from kwaegel/patch-1
Use push/pop macro when supressing warning
2019-01-23 08:21:27 +01:00
Shinichiro Hamaji
1d98d00c7e Update ChangeLog to record release dates at least 2019-01-23 12:24:15 +09:00
Ky Waegel
342fa2674c
Use push/pop macro when supressing warning
* Same as PR #397 , but for the `.in` file. Useful for some unusual cross-platform build environments (e.g. WSL).
2019-01-22 10:59:05 -08:00
Shinichiro Hamaji
406b0e702f glog: release 0.4.0 2019-01-22 21:00:50 +09:00
Shinichiro Hamaji
6d6d31872e Run src/windows/preprocess.sh 2019-01-22 20:58:13 +09:00
Haakan Younes
5d46e1bcfc Add demangle support for ABI tags. (#416)
Support ABI tags after <local-source-name> in demangle.cc.
Update the reference URL.

Fixes #50
2019-01-07 15:30:23 +09:00
Thomas Anderson
7fcb278d1e Fix demangling template parameter packs (#414)
* Fix demangling template parameter packs

Clang 4.0.1-10 and gcc 7.3.0 both mangle the function "void add<int>(int)" as
"_Z3addIJiEEvDpT_".  The template parameter pack is of the form
J <template-arg>* E

The opening character for a param pack could be either I or J, as libiberty
follows [1].  This change simply adds the J case.

[1] fbd263526a/libiberty/cp-demangle.c (L3209)
2019-01-07 15:26:08 +09:00