[Pkg-lirc-maint] Bug#456573: lirc: lirc is too verbose

Arnaud Patard arnaud.patard at rtp-net.org
Sun Dec 16 17:49:04 UTC 2007


Package: lirc
Version: 0.8.0-13
Severity: normal
Tag: Patch

I'm using lirc with dev/input driver and every keypress I get :

lircd-0.8.0[3676]: devinput_rec
lircd-0.8.0[3676]: time 1197825829.895450  type 1  code 108  value 1
lircd-0.8.0[3676]: code 8001006c

I've made a small patch to allow setting lirc verbosity like for the LOGPRINTF()
macros. Please consider applying it.

Also, having a rule in logcheck to catch "lircd(%s) ready" would be nice :)



-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-rc4 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages lirc depends on:
ii  debconf [debconf-2.0]     1.5.17         Debian configuration management sy
ii  dialog                    1.1-20071028-1 Displays user-friendly dialog boxe
ii  libasound2                1.0.15-3       ALSA library
ii  libc6                     2.7-4          GNU C Library: Shared libraries
ii  liblircclient0            0.8.0-13       infra-red remote control support -
ii  libusb-0.1-4              2:0.1.12-7     userspace USB programming library

lirc recommends no packages.

-- debconf information:
  lirc/take_care_of_old_config:
  lirc/install_devices: true
  lirc/reconfigure: false
  lirc/lircmd_conf:
  lirc/remove_var-log-lircd: true
  lirc/driver:
  lirc/should-use-IntelliMouse:
  lirc/cflags:
  lirc/irq:
  lirc/lircd_conf:
  lirc/port:
  lirc/device:
  lirc/timer:
  lirc/modules:

===File /datas2/builds/lirc/0.8.0-13-mod/lirc-0.8.0/patches/16_fix_syslog_output.dpatch===
#! /bin/sh /usr/share/dpatch/dpatch-run

---
 daemons/lircd.c |   11 	2 +	9 -	0 !
 daemons/lircd.h |    3 	2 +	1 -	0 !
 2 files changed, 4 insertions(+), 10 deletions(-)
@DPATCH@
Index: lirc-0.8.0/daemons/lircd.h
===================================================================
--- lirc-0.8.0.orig/daemons/lircd.h	2007-12-16 17:59:45.000000000 +0100
+++ lirc-0.8.0/daemons/lircd.h	2007-12-16 17:59:49.000000000 +0100
@@ -54,7 +54,8 @@ void start_server(mode_t permission,int 
 #endif
 
 #ifdef USE_SYSLOG
-#define logprintf syslog
+#define logprintf(level,fmt,args...) \
+  if(level<=debug) syslog(level,fmt, ## args )
 #define logperror(prio,s) if((s)!=NULL) syslog(prio,"%s: %m\n",(char *) s); else syslog(prio,"%m\n")
 #else
 void logprintf(int prio,char *format_str, ...);
Index: lirc-0.8.0/daemons/lircd.c
===================================================================
--- lirc-0.8.0.orig/daemons/lircd.c	2007-12-16 17:59:45.000000000 +0100
+++ lirc-0.8.0/daemons/lircd.c	2007-12-16 18:26:47.000000000 +0100
@@ -1829,6 +1829,7 @@ int main(int argc,char **argv)
 	mode_t permission=S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
 	char *device=NULL;
 
+	debug=LOG_NOTICE;
 	hw_choose_driver(NULL);
 	while(1)
 	{
@@ -1848,18 +1849,14 @@ int main(int argc,char **argv)
 #                       ifndef USE_SYSLOG
                         {"logfile",required_argument,NULL,'L'},
 #                       endif
-#                       ifdef DEBUG
 			{"debug",optional_argument,NULL,'D'},
-#                       endif
 			{0, 0, 0, 0}
 		};
 		c = getopt_long(argc,argv,"hvnp:H:d:o:P:l::c:"
 #                               ifndef USE_SYSLOG
 				"L:"
 #                               endif
-#                               ifdef DEBUG
-				"D::"
-#                               endif
+				"D:"
 				,long_options,NULL);
 		if(c==-1)
 			break;
@@ -1880,9 +1877,7 @@ int main(int argc,char **argv)
 #                       ifndef USE_SYSLOG
                         printf("\t -L --logfile=file\t\tdaemon log file\n");
 #                       endif
-#                       ifdef DEBUG
 			printf("\t -D[debug_level] --debug[=debug_level]\n");
-#                       endif
 			return(EXIT_SUCCESS);
 		case 'v':
 			printf("%s %s\n",progname,VERSION);
@@ -1946,7 +1941,6 @@ int main(int argc,char **argv)
 			if(!add_peer_connection(optarg))
 				return(EXIT_FAILURE);
 			break;
-#               ifdef DEBUG
 		case 'D':
 			if(optarg==NULL) debug=1;
 			else
@@ -1955,7 +1949,6 @@ int main(int argc,char **argv)
 				debug=atoi(optarg);
 			}
 			break;
-#               endif
 		default:
 			printf("Usage: %s [options] [config-file]\n",progname);
 			return(EXIT_FAILURE);
============================================================





More information about the Pkg-lirc-maint mailing list