summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Pepper <timothy.c.pepper@linux.intel.com>2012-11-26 17:13:38 -0800
committerTim Pepper <timothy.c.pepper@linux.intel.com>2012-11-26 17:13:38 -0800
commit507fd7cdf709730d2fc4f8a4b9c21e5503bee1de (patch)
treea44846549c8dd23109b7bfc21cbdc2f4eb9baa57
parent886fd4a8b634621ab15f4aa8bc64aab7d719d53a (diff)
downloadcorewatcher-507fd7cdf709730d2fc4f8a4b9c21e5503bee1de.tar.gz
corewatcher-507fd7cdf709730d2fc4f8a4b9c21e5503bee1de.tar.bz2
corewatcher-507fd7cdf709730d2fc4f8a4b9c21e5503bee1de.zip
simplify/cleanr-up syslog'd messages
Signed-off-by: Tim Pepper <timothy.c.pepper@linux.intel.com>
-rw-r--r--src/coredump.c18
-rw-r--r--src/submit.c6
2 files changed, 10 insertions, 14 deletions
diff --git a/src/coredump.c b/src/coredump.c
index 6244801..d68c6ca 100644
--- a/src/coredump.c
+++ b/src/coredump.c
@@ -708,7 +708,7 @@ static void disable_corefiles(int diskfree)
if (ret != -1) {
fprintf(stderr, "+ disabled core pattern, disk low %d%%\n", diskfree);
syslog(LOG_WARNING,
- "Disabled kernel core_pattern, %s only has %d%% available",
+ "corewatcher: disabled kernel core_pattern, %s only has %d%% available",
core_folder, diskfree);
}
}
@@ -729,18 +729,18 @@ void enable_corefiles(int diskfree)
goto err;
if (diskfree == -1) {
- fprintf(stderr, "+ enabled core pattern\n");
- syslog(LOG_INFO, "Enabled corewatcher kernel core_pattern\n");
+ fprintf(stderr, "+ enabled core pattern\n");
+ syslog(LOG_INFO, "corewatcher: enabled kernel core_pattern\n");
} else {
- fprintf(stderr, "+ reenabled core pattern, disk %d%%", diskfree);
- syslog(LOG_WARNING,
- "Reenabled corewatcher kernel core_pattern, %s now has %d%% available",
- core_folder, diskfree);
+ fprintf(stderr, "+ reenabled core pattern, disk %d%%", diskfree);
+ syslog(LOG_WARNING,
+ "corewatcher: reenabled kernel core_pattern, %s now has %d%% available",
+ core_folder, diskfree);
}
return;
err:
fprintf(stderr, "+ unable to enable core pattern\n");
- syslog(LOG_WARNING, "Unable to enable kernel core_pattern\n");
+ syslog(LOG_WARNING, "corewatcher: unable to enable kernel core_pattern\n");
return;
}
@@ -753,12 +753,10 @@ int scan_folders(void __unused *unused)
if (statvfs(core_folder, &stat) == 0) {
newdiskfree = (int)(100 * stat.f_bavail / stat.f_blocks);
- openlog("corewatcher", 0, LOG_KERN);
if ((newdiskfree < 10) && (diskfree >= 10))
disable_corefiles(newdiskfree);
if ((newdiskfree > 12) && (diskfree <= 12))
enable_corefiles(newdiskfree);
- closelog();
diskfree = newdiskfree;
}
diff --git a/src/submit.c b/src/submit.c
index c894584..a646c5c 100644
--- a/src/submit.c
+++ b/src/submit.c
@@ -274,12 +274,10 @@ void *submit_loop(void __unused *unused)
}
}
- openlog("corewatcher", 0, LOG_KERN);
if (sentcount)
- syslog(LOG_WARNING, "Successful sent %d coredump signatures to %s", sentcount, submit_url[i]);
+ syslog(LOG_INFO, "corewatcher: Successfully sent %d coredump signatures to %s", sentcount, submit_url[i]);
if (failcount)
- syslog(LOG_WARNING, "Failed to send %d coredump signatures to %s", failcount, submit_url[i]);
- closelog();
+ syslog(LOG_INFO, "corewatcher: Failed to send %d coredump signatures to %s", failcount, submit_url[i]);
break;
}