aboutsummaryrefslogtreecommitdiff
path: root/compat/win32/syslog.h
diff options
context:
space:
mode:
authorMike Pape <dotzenlabs@gmail.com>2010-11-04 02:35:10 +0100
committerJunio C Hamano <gitster@pobox.com>2010-11-04 16:53:49 -0700
commit088d880247dc7bb1a27f07e320bab7f9b63e06bc (patch)
tree61627c7e060200965156b79f58f48c5f77bed83d /compat/win32/syslog.h
parent772991af40e139814368762d4075be324bfdab77 (diff)
downloadgit-088d880247dc7bb1a27f07e320bab7f9b63e06bc.tar.gz
git-088d880247dc7bb1a27f07e320bab7f9b63e06bc.tar.xz
mingw: implement syslog
Syslog does not usually exist on Windows, so implement our own using Window's ReportEvent mechanism. Strings containing "%1" gets expanded into them selves by ReportEvent, resulting in an unreadable string. "%2" and above is not a problem. Unfortunately, on Windows an IPv6 address can contain "%1", so expand "%1" to "% 1" before reporting. "%%1" is also a problem for ReportEvent, but that string cannot occur in an IPv6 address. Signed-off-by: Mike Pape <dotzenlabs@gmail.com> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/win32/syslog.h')
-rw-r--r--compat/win32/syslog.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/compat/win32/syslog.h b/compat/win32/syslog.h
new file mode 100644
index 000000000..70daa7c08
--- /dev/null
+++ b/compat/win32/syslog.h
@@ -0,0 +1,20 @@
+#ifndef SYSLOG_H
+#define SYSLOG_H
+
+#define LOG_PID 0x01
+
+#define LOG_EMERG 0
+#define LOG_ALERT 1
+#define LOG_CRIT 2
+#define LOG_ERR 3
+#define LOG_WARNING 4
+#define LOG_NOTICE 5
+#define LOG_INFO 6
+#define LOG_DEBUG 7
+
+#define LOG_DAEMON (3<<3)
+
+void openlog(const char *ident, int logopt, int facility);
+void syslog(int priority, const char *fmt, ...);
+
+#endif /* SYSLOG_H */