summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f271d4b)
raw | patch | inline | side by side (parent: f271d4b)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 26 Mar 2007 09:24:41 +0000 (11:24 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 26 Mar 2007 09:24:41 +0000 (11:24 +0200) |
src/logfile.c | patch | blob | history |
diff --git a/src/logfile.c b/src/logfile.c
index fed0a75ebc154bcb96598e077b7588e58fa83c9d..d251284ba1ed89b22d976002ada5e635c4e09ee3 100644 (file)
--- a/src/logfile.c
+++ b/src/logfile.c
/**
- * collectd - src/stderr.c
+ * collectd - src/logfile.c
* Copyright (C) 2007 Sebastian Harl
*
* This program is free software; you can redistribute it and/or modify it
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
-static int stderr_config (const char *key, const char *value)
+static int logfile_config (const char *key, const char *value)
{
if (0 == strcasecmp (key, "LogLevel")) {
if ((0 == strcasecmp (value, "emerg"))
else {
char errbuf[1024];
/* We can't use `ERROR' yet.. */
- fprintf (stderr, "stderr plugin: Access to %s denied: %s\n",
+ fprintf (stderr, "logfile plugin: Access to %s denied: %s\n",
value, sstrerror (errno, errbuf, sizeof (errbuf)));
return 1;
}
return -1;
}
return 0;
-} /* int stderr_config (const char *, const char *) */
+} /* int logfile_config (const char *, const char *) */
-static void stderr_log (int severity, const char *msg)
+static void logfile_log (int severity, const char *msg)
{
FILE *fh;
int do_close = 0;
if (fh == NULL)
{
char errbuf[1024];
- fprintf (stderr, "stderr plugin: fopen (%s) failed: %s\n",
+ fprintf (stderr, "logfile plugin: fopen (%s) failed: %s\n",
(log_file == NULL) ? "<null>" : log_file,
sstrerror (errno, errbuf, sizeof (errbuf)));
}
pthread_mutex_unlock (&file_lock);
return;
-} /* void stderr_log (int, const char *) */
+} /* void logfile_log (int, const char *) */
void module_register (void)
{
- plugin_register_config ("stderr", stderr_config,
+ plugin_register_config ("logfile", logfile_config,
config_keys, config_keys_num);
- plugin_register_log ("stderr", stderr_log);
+ plugin_register_log ("logfile", logfile_log);
return;
} /* void module_register (void) */