[Nagios-checkins] CVS: nagios/base logging.c,1.16,1.17
Nagios network monitoring software is enterprise server monitoring
Brought to you by:
egalstad,
sawolf-nagios
From: Ethan G. <ega...@us...> - 2004-02-16 05:58:10
|
Update of /cvsroot/nagios/nagios/base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20036/base Modified Files: logging.c Log Message: Added contactgroups directive to contact definitions Index: logging.c =================================================================== RCS file: /cvsroot/nagios/nagios/base/logging.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** logging.c 9 Nov 2003 00:29:05 -0000 1.16 --- logging.c 16 Feb 2004 05:50:20 -0000 1.17 *************** *** 3,8 **** * LOGGING.C - Log file functions for use with Nagios * ! * Copyright (c) 1999-2003 Ethan Galstad (na...@na...) ! * Last Modified: 11-08-2003 * * License: --- 3,8 ---- * LOGGING.C - Log file functions for use with Nagios * ! * Copyright (c) 1999-2004 Ethan Galstad (na...@na...) ! * Last Modified: 02-14-2004 * * License: *************** *** 64,67 **** --- 64,69 ---- /* write something to the log file, syslog, and possibly the console */ int write_to_logs_and_console(char *buffer, unsigned long data_type, int display){ + int len; + int x; #ifdef DEBUG0 *************** *** 69,72 **** --- 71,83 ---- #endif + /* strip unecessary newlines */ + len=strlen(buffer); + for(x=len-1;x>=0;x--){ + if(buffer[x]=='\n') + buffer[x]='\x0'; + else + break; + } + /* write messages to the logs */ write_to_all_logs(buffer,data_type); *************** *** 165,169 **** fp=fopen(log_file,"a+"); if(fp==NULL){ ! printf("Warning: Cannot open log file '%s' for writing\n",log_file); return ERROR; } --- 176,181 ---- fp=fopen(log_file,"a+"); if(fp==NULL){ ! if(daemon_mode==FALSE) ! printf("Warning: Cannot open log file '%s' for writing\n",log_file); return ERROR; } |