18671178307 / google-glog

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

Add fixed log name support #209

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
More of a pull request rather than an issue. It would be nice to have a fixed 
file name for log files, e.g. instead of base_filename + filename_extension + 
time_pid_string it could be switched to base_filename + filename_extension. I 
propose the addition of a flag that allows to switch behavior, while still 
defaulting to the current behavior to avoid breakage in existing code. This 
change would allow easier log rotation schemes and better control on what's 
written on disk.

This is similar but not the same issue of 
https://code.google.com/p/google-glog/issues/detail?id=89 .

What steps will reproduce the problem?
1. initialize logging

What is the expected output? What do you see instead?
The log file would have a fixed name, e.g. myapplication.log .
Instead, we currently have a log name like myapplication.log.timestamp-pid .

What version of the product are you using? On what operating system?
google-glog 0.3.3 on various Linux flavors. The change would be OS-independent.

Please provide any additional information below.
The new behavior would not break the existing code, by maintaining the default 
log name generation scheme. The proposed approach is to add a boolean flag, 
e.g. FLAGS_timestamp_in_logfile_name . This flag should be set to true to 
enable the proposed behavior, and defaults to false.
The patch is an initial hint on how to do this, but it needs to enforce that 
the flag is not changed when logging is initialized.

Original issue reported on code.google.com by barbe...@amazon.com on 20 May 2014 at 5:03

Attachments: