pombreda / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

Errors while logging to specified directory(without that directory) does not tell anything. #155

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. std::string dir_log_filename = "log/" + log_filename;
   google::SetLogDestination(google::INFO, dir_log_filename.c_str());
   google::SetLogFilenameExtension(".log.");
2. Do not mkdir 'log'
3. Try to write anything to log 

What is the expected output? What do you see instead?
expected:
Could not create log file: No such file or directory
COULD NOT CREATE LOGFILE 'log/test.log.20130404-164802.60398'!

i see:
Could not create log file: No such file or directory
COULD NOT CREATE LOGFILE '20130404-164802.60398'!

What version of the product are you using? On what operating system?
glog 0.3.2, any

Please provide any additional information below.

supposed fix:
-        fprintf(stderr, "COULD NOT CREATE LOGFILE '%s'!\n", time_pid_string);
+        fprintf(stderr, "COULD NOT CREATE LOGFILE '%s%s%s'!\n", 
base_filename_.c_str(), filename_extension_.c_str(), time_pid_string);

Original issue reported on code.google.com by russiaf...@gmail.com on 4 Apr 2013 at 1:08