Commit Graph

25 Commits

Author SHA1 Message Date
LingBin
da9753409b
fix(cleanup): ensure FLAGS_log_dir ends with '/' (#972) 2023-10-12 13:35:52 +02:00
Vijaymahantesh Sattigeri
6969412183 Changed my Email ID 2022-01-19 21:50:30 +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
Shen Zhuoran
503e3dec8d Add Zhuoran Shen to AUTHORS and CONTRIBUTORS
I previously made a minor documentation fix in
https://github.com/google/glog/pull/747. According to README, this
commit adds myself to AUTHORS and CONTRIBUTORS.
2021-11-28 13:44:23 +01:00
Sergiu Deitsch
ab5e109298 Revert "cmake: fix incorrect relative path concatenation (#733)"
This reverts commit 68964b8db6.
2021-11-11 21:56:25 +01:00
Niklas Hambüchen
68964b8db6
cmake: fix incorrect relative path concatenation (#733)
When a `-DCMAKE_INSTALL_PREFIX` is given, this could result in paths like:

    /path/to/prefix//path/to/prefix/lib/cmake/glog/glog-modules.cmake

which was incorrect.

If a relative `DESTINATION` is given, it's assumed to be relative to the install prefix.
2021-11-05 22:19:36 +01: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
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
romkatv
29dd5da60f Add Roman Perepelitsa to AUTHORS and CONTRIBUTORS 2019-02-16 19:31:50 +01:00
Shinichiro Hamaji
4682134d59 Update AUTHORS and CONTRIBUTORS for PR#232 2017-12-20 17:27:27 +09:00
Andrew Schwartzmeyer
bcaaa5d29b Add Andrew Schwartzmeyer to authors and contributors 2017-06-26 16:21:10 -07:00
Fumitoshi Ukai
b6a5e0524c Update github.com/sergiud in AUTHORS/CONTRIBUTORS 2016-10-20 15:53:26 +09:00
Fumitoshi Ukai
5080258031 Add MiniLight to AUTHORS/CONTRIBUTORS 2016-10-19 16:28:53 +09:00
Fumitoshi Ukai
ff5fa62a5f Add Andy Ying to AUTHORS/CONTRIBUTORS 2016-10-19 16:09:41 +09:00
Fumitoshi Ukai
b3a1dc359d Add Guillaume Dumont to AUTHORS/CONTRIBUTORS 2016-10-19 15:59:24 +09:00
Abhishek Dasgupta
b27d0420fb Added support for PowerPC. 2016-03-21 11:28:53 +00:00
Fumitoshi Ukai
4dd62b0547 Add Teddy Reed to AUTHORS/CONTRIBUTORS 2015-08-12 16:06:34 +09:00
Fumitoshi Ukai
254db0ae1b Merge pull request #34 from bsilver8192/fix-macro-redefinition
Fix redefinition of _XOPEN_SOURCE.
2015-08-06 17:15:44 +09:00
Fumitoshi Ukai
4a1e5ef60c Add tomange to AUTHORS/CONTRIBUTORS 2015-08-06 17:10:21 +09:00
Fumitoshi Ukai
e91d5c4d02 Add Sergiu Dotenco to AUTHORS/CONTRIBUTORS 2015-08-06 16:55:37 +09:00
Fumitoshi Ukai
454906f44b Add Michael Tanner and tbennun to AUTORS/CONTRIBUTORS 2015-08-06 16:45:44 +09:00
Brian Silverman
287ab79862 Add Brian Silverman to AUTHORS+CONTRIBUTORS. 2015-06-16 16:49:53 -07:00
Pierre Phaneuf
2a02db7aa5 Add Abhishek Parmar to the AUTHORS/CONTRIBUTORS files. 2015-04-23 11:41:53 +01:00
Pierre Phaneuf
80942e5ea2 Add the typical Google contributors and authors files.
Also add a CONTRIBUTING.md, that GitHub will link to in the pull request
creation page.
2015-03-16 10:50:32 +00:00
b8b4db46fe glog 0.1
git-svn-id: https://google-glog.googlecode.com/svn/trunk@2 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-10-07 05:43:05 +00:00