[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ildar Muslukhov <ildarm@xxxxxxxxxx>

---
 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

--
To unsubscribe from this list: send the line "unsubscribe trinity" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux