Comments (5)
I agree with that, probably one file per day
In log4j this feature is Rolling file log
Original comment by [email protected]
on 15 Mar 2010 at 4:31
from google-glog.
I think I answered the original issue (add log message into the same file) in
Issue
26:
INFO log file should have all log levels. Isn't it sufficient?
http://google-glog.googlecode.com/svn/trunk/doc/glog.html#severity
Note that messages of a given severity are logged not only in the logfile for
that
severity, but also in all logfiles of lower severity. E.g., a message of
severity
FATAL will be logged to the logfiles of severity FATAL, ERROR, WARNING, and
INFO.
Original comment by [email protected]
on 27 May 2010 at 10:26
from google-glog.
It would be nice to not be forced to have the WARNING and ERROR log files
created for you. Some kind of env variable / command line option to enable /
disable this feature would be good.
Having the extra WARNING and ERROR log files just creates clutter for us.
Also, it would be good to buffer INFO messages and flush them out to the one
file periodically or as soon as a WARNING or ERROR message is processed for the
same file. i.e. the buffering is on a per message basis and not applied to the
whole of the INFO logger.
Original comment by [email protected]
on 28 Jun 2010 at 2:11
from google-glog.
While I agree that this would be preferable, you can arrange this under the
current system using the public API's by calling
for (google::LogSeverity s = WARNING; s < google::NUM_SEVERITIES; s++)
google::SetLogDestination(s, "");
google::SetLogDestination(INFO, "/path/to/file");
Then all messages will be logged to only to the file for INFO.
This is a workaround only. but if you are wrapping glog in another layer (like
I am in my project) then it is probably sufficient.
Rotation should probably be handled externally. To make sure you reopen the
file you will need to periodically re-call SetLogDestination(INFO,
"/path/to/file") again so that glog will reopen the file if it has been
displaced.
Original comment by donald.b.guy
on 29 Jun 2010 at 5:41
from google-glog.
FYI, there is another way to suppress log files.
#include <glog/logging.h>
using namespace google;
using namespace std;
struct NullLogger : public base::Logger {
virtual void Write(bool should_flush,
time_t timestamp,
const char* message,
int length) {
}
virtual void Flush() { }
virtual uint32 LogSize() { return 0; }
};
void SetMyLogger(int severity, base::Logger* logger) {
base::Logger* old_logger = base::GetLogger(severity);
base::SetLogger(severity, logger);
FlushLogFiles(severity);
}
int main(int argc, char* argv[]) {
InitGoogleLogging(argv[0]);
NullLogger null_logger;
SetMyLogger(WARNING, &null_logger);
SetMyLogger(ERROR, &null_logger);
SetMyLogger(FATAL, &null_logger);
LOG(INFO) << "info";
LOG(WARNING) << "warn";
LOG(ERROR) << "error";
LOG(FATAL) << "fatal";
}
Original comment by [email protected]
on 1 Jul 2010 at 6:56
from google-glog.
Related Issues (20)
- Cannot Build Google-GLog on Visual Studio 2013 HOT 2
- Warning Reduction... HOT 1
- -lexecinfo is needed for backtrace() on FreeBSD HOT 1
- in VS2008 release case, the process crashed when glog output int,long and so on(numerical var)
- Error compiling glog-0.3.3
- unused parameters in mock-log.h
- Link Error while making gLog (recompile with -fIPC)
- .
- make: *** [logging_unittest-logging_unittest.o] Error 1
- Cannot compile on Linux gcc 4.8.1 HOT 1
- vector size() incompatability
- Glog‘s all functions are worked but InstallFailureSignalHandler() Linking failed in vs2010 HOT 2
- Add LOG_EVERY_N_SECS
- V0.3.3 build error under VS 2013 (v120)
- Demangle failed
- Process sleeps forever in FailureSignalHandler it is interrupted by another signal.
- -fPIC issue
- Symbolize can't handler address of plt
- OSX Make Error issue
- Question: how to get log file name?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-glog.