Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ambrop72/badvpn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorambrop7 <ambrop7@1a93d707-3861-5ebc-ad3b-9740d49b5140>2012-02-21 20:36:13 +0400
committerambrop7 <ambrop7@1a93d707-3861-5ebc-ad3b-9740d49b5140>2012-02-21 20:36:13 +0400
commit9bfbd8446f199febf84bf3bff395b3c6c951fe1a (patch)
treee51d6cad51371dc58eb6066d6e3348f8dc65eafe /base
parent7b7e1c477bb7e8ba46a383eaa4310e33ead8604c (diff)
base: BLog: add BLog_InitStderr()
Diffstat (limited to 'base')
-rw-r--r--base/BLog.c16
-rw-r--r--base/BLog.h1
2 files changed, 14 insertions, 3 deletions
diff --git a/base/BLog.c b/base/BLog.c
index c9b1c56..e3e0823 100644
--- a/base/BLog.c
+++ b/base/BLog.c
@@ -51,14 +51,24 @@ static char *level_names[] = {
static void stdout_log (int channel, int level, const char *msg)
{
- printf("%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg);
+ fprintf(stdout, "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg);
}
-static void stdout_free (void)
+static void stderr_log (int channel, int level, const char *msg)
+{
+ fprintf(stderr, "%s(%s): %s\n", level_names[level], blog_global.channels[channel].name, msg);
+}
+
+static void stdout_stderr_free (void)
{
}
void BLog_InitStdout (void)
{
- BLog_Init(stdout_log, stdout_free);
+ BLog_Init(stdout_log, stdout_stderr_free);
+}
+
+void BLog_InitStderr (void)
+{
+ BLog_Init(stderr_log, stdout_stderr_free);
}
diff --git a/base/BLog.h b/base/BLog.h
index eb3a50e..bdea4e1 100644
--- a/base/BLog.h
+++ b/base/BLog.h
@@ -89,6 +89,7 @@ static void BLog_LogViaFuncVarArg (BLog_logfunc func, void *arg, int channel, in
static void BLog_LogViaFunc (BLog_logfunc func, void *arg, int channel, int level, const char *fmt, ...);
void BLog_InitStdout (void);
+void BLog_InitStderr (void);
int BLogGlobal_GetChannelByName (const char *channel_name)
{