mire787 / google-glog

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

Selecting facility when logging to syslog. #68

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
 * What steps will reproduce the problem?

  It's not possible to select through a flag which syslog facility to use.

 * What is the expected output?

  To log to a different facility instead of LOG_USER

 * What version of the product are you using? On what operating system?

  0.3.1

 * Please provide any additional information below.

  I made a patch that implements this. If you wish, I can attach it for peer review. 

Thanx in advance.

Original issue reported on code.google.com by fooi...@gmail.com on 6 Oct 2010 at 4:29

GoogleCodeExporter commented 8 years ago
I am interested in this patch... please post it if you can.

Original comment by Horacio....@gmail.com on 7 Oct 2010 at 3:36

GoogleCodeExporter commented 8 years ago
Patch attached.

Original comment by fooi...@gmail.com on 7 Oct 2010 at 11:16

Attachments:

GoogleCodeExporter commented 8 years ago
An alternative fix would be to remove the facility specification from the call 
to syslog in line 110 of the patch supplied in comment 2. (that is, don't | 
(or) anything with SEVERITY_TO_LEVEL.

Then, you can change the facility on the fly by simply making another call to 
openlog with a new facility specification.

 patch inline:

-  syslog(LOG_USER | SEVERITY_TO_LEVEL[static_cast<int>(data_->severity_)], 
"%.*s",
+  // don't specify the facility here; use the facility spec'd in openlog()
+  syslog(SEVERITY_TO_LEVEL[static_cast<int>(data_->severity_)], "%.*s",

Original comment by j...@solidfire.com on 19 May 2011 at 11:22