public inbox for trinity@vger.kernel.org
 help / color / mirror / Atom feed
From: Ildar Muslukhov <ildarm@google.com>
To: trinity@vger.kernel.org
Cc: davej@redhat.com, Ildar Muslukhov <ildarm@google.com>
Subject: [PATCH 1/6] added outputerr/outputstd log functions
Date: Tue,  8 Oct 2013 14:26:50 -0700	[thread overview]
Message-ID: <1381267615-9826-1-git-send-email-ildarm@google.com> (raw)

Signed-off-by: Ildar Muslukhov <ildarm@google.com>

---
 include/log.h |  2 ++
 log.c         | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/include/log.h b/include/log.h
index 2497988..7041eda 100644
--- a/include/log.h
+++ b/include/log.h
@@ -25,6 +25,8 @@
 unsigned int highest_logfile(void);
 void synclogs(void);
 void output(unsigned char level, const char *fmt, ...);
+void outputerr(const char *fmt, ...);
+void outputstd(const char *fmt, ...);
 void open_logfiles(void);
 void close_logfiles(void);
 
diff --git a/log.c b/log.c
index 850a3e2..144567a 100644
--- a/log.c
+++ b/log.c
@@ -221,3 +221,25 @@ void output(unsigned char level, const char *fmt, ...)
 	fprintf(handle, "%s %s", prefix, monobuf);
 	(void)fflush(handle);
 }
+
+/*
+* Used as a way to consolidated all printf calls if someones one to redirect it to somewhere else.
+* note: this function ignores quiet_level since it main purpose is error output.
+*/
+void outputerr(const char *fmt, ...)
+{
+	va_list args;
+
+	va_start(args, fmt);
+	vfprintf(stderr, fmt, args);
+	va_end(args);
+}
+
+void outputstd(const char *fmt, ...)
+{
+	va_list args;
+
+	va_start(args, fmt);
+	vfprintf(stdout, fmt, args);
+	va_end(args);
+}
-- 
1.8.4

             reply	other threads:[~2013-10-08 21:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08 21:26 Ildar Muslukhov [this message]
2013-10-08 21:26 ` [PATCH 2/6] wired outputstd/err functions Ildar Muslukhov
2013-10-08 21:26 ` [PATCH 3/6] refactored output function Ildar Muslukhov
2013-10-10 18:20   ` Dave Jones
2013-10-15 17:07     ` Ildar Muslukhov
2013-10-08 21:26 ` [PATCH 4/6] wired in output function instead of printf (and some missing outputstd) Ildar Muslukhov
2013-10-09 16:23   ` Dave Jones
2013-10-09 21:40     ` Dave Jones
2013-10-08 21:26 ` [PATCH 5/6] added bufferless logging functions for syscall pamaters Ildar Muslukhov
2013-10-09 16:27   ` Dave Jones
2013-10-08 21:26 ` [PATCH 6/6] wired syscall parameters logging function into syscall (this should fix stack smash bug detected) Ildar Muslukhov
2013-10-09 16:28   ` Dave Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381267615-9826-1-git-send-email-ildarm@google.com \
    --to=ildarm@google.com \
    --cc=davej@redhat.com \
    --cc=trinity@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox