blob: 8e16b43bfb333bd4cb49a17c70974ec6c93fa0bd [file] [log] [blame]
From 349963dc68cebf8d2e60d0f9ece6e95573366a59 Mon Sep 17 00:00:00 2001
From: Sameer Nanda <snanda@chromium.org>
Date: Tue, 16 Feb 2010 16:24:26 -0800
Subject: [PATCH 4/8] Add config knob to control syslog facility
Modified for 1.57
Signed-off-by: Sameer <snanda@chromium.org>
Signed-off-by: Simon Que <sque@chromium.org>
Change-Id: I9192a41ea84ed957fcd2ebb7e03e2defb16412ac
---
.../etc/laptop-mode/laptop-mode.conf | 2 ++
laptop-mode-tools-1.59/usr/sbin/laptop_mode | 13 +++++++------
2 files changed, 9 insertions(+), 6 deletions(-)
diff -ruN laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf laptop-mode-tools-1.59.new/etc/laptop-mode/laptop-mode.conf
index e0a6e06..47a2381 100644
--- laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf
+++ laptop-mode-tools-1.59.new/etc/laptop-mode/laptop-mode.conf
@@ -60,6 +60,8 @@ VERBOSE_OUTPUT=0
# Set this to 1 if you want to log messages to syslog
LOG_TO_SYSLOG=1
+# syslog facility passed to logger -t when LOG_TO_SYSLOG is 1
+SYSLOG_FACILITY=daemon
# Run in shell debug mode
# Enable this if you would like to execute the entire laptop-mode-tools program
diff -ruN laptop-mode-tools-1.59/usr/sbin/laptop_mode laptop-mode-tools-1.59.new/usr/sbin/laptop_mode
index 2827569..8acbc68 100644
--- laptop-mode-tools-1.59/usr/sbin/laptop_mode
+++ laptop-mode-tools-1.59.new/usr/sbin/laptop_mode
@@ -127,6 +127,7 @@ BATT_BRIGHTNESS_COMMAND=false
LM_AC_BRIGHTNESS_COMMAND=false
NOLM_AC_BRIGHTNESS_COMMAND=false
LOG_TO_SYSLOG=1
+SYSLOG_FACILITY=daemon
DEBUG=0
ENABLE_LAPTOP_MODE_TOOLS=1
@@ -160,15 +161,15 @@ if [ x$LOG_TO_SYSLOG = x1 ]; then
# continue
#elif [ "$1" = "MSG" ]; then
if [ "$1" = "MSG" ]; then
- logger -p daemon.info -t laptop-mode "$2";
+ logger -p $SYSLOG_FACILITY.info -t laptop-mode "$2";
elif [ "$1" = "ERR" ]; then
- logger -p daemon.err -t laptop-mode "$2";
+ logger -p $SYSLOG_FACILITY.err -t laptop-mode "$2";
elif [ "$1" = "VERBOSE" ]; then
- if [ x$VERBOSE_OUTPUT = x1 ]; then
- logger -p daemon.debug -t laptop-mode "$2";
- fi
+ if [ x$VERBOSE_OUTPUT = x1 ]; then
+ logger -p $SYSLOG_FACILITY.debug -t laptop-mode "$2";
+ fi
else
- logger -p daemon.notice -t laptop-mode "$2";
+ logger -p $SYSLOG_FACILITY.notice -t laptop-mode "$2";
fi
fi
fi
--
1.7.2.3