summaryrefslogtreecommitdiff
path: root/src/log
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-03-19 13:37:50 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-03-19 13:37:50 +0100
commite0d923b209f0e310a3f6247b31d34930ca26fbaa (patch)
treeb119eeded9158aaf49a0c6d120800180506bd4ce /src/log
parent02c0ec4727710a679bd2f436a6fe67b707a22c84 (diff)
downloadwolfbones-e0d923b209f0e310a3f6247b31d34930ca26fbaa.tar.gz
wolfbones-e0d923b209f0e310a3f6247b31d34930ca26fbaa.tar.bz2
started to add a message mc generator script
Diffstat (limited to 'src/log')
-rwxr-xr-xsrc/log/create_wolfmsg.pl92
-rw-r--r--src/log/wolfmsg.mc17
2 files changed, 105 insertions, 4 deletions
diff --git a/src/log/create_wolfmsg.pl b/src/log/create_wolfmsg.pl
index e69de29..bdcdeee 100755
--- a/src/log/create_wolfmsg.pl
+++ b/src/log/create_wolfmsg.pl
@@ -0,0 +1,92 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+# header declaring the langages
+print <<EOF;
+;// messages file for wolf messages
+
+;// language codes for translated messages
+;// (409 ist the windows locale for en-US)
+;// (see http://msdn.microsoft.com/en-us/library/ms776260.aspx)
+LanguageNames = (
+ English = 0x0409 : MSG00409
+ German = 0x0407 : MSG00407
+)
+
+;// Category names come first, the 'CategoryCount' registry entry
+;// for the event source must match the number of entries here.
+;// Also the numbering must be strictly starting by one and increase
+;// by one. Careful: categories MUST be defined here, the message
+;// compiler is a little bit flag and context infected. Also make
+;// sure they are not longer than 10 characters, the event viewer
+;// field is quite small.
+
+EOF
+
+print <<EOF;
+MessageId = 0x1
+SymbolicName = WOLF_CATEGORY_1
+Language = English
+Logger
+.
+Language = German
+Logger
+.
+
+MessageId = 0x2
+SymbolicName = WOLF_CATEGORY_2
+Language = English
+Dameon
+.
+Language = German
+Unix-Prozess
+.
+EOF
+
+print <<EOF;
+
+# constants things defined by the event logger (advapi32.dll)
+
+;// event log severity levels (severity bits)
+SeverityNames = (
+ Success = 0x0 : STATUS_SEVERITY_SUCCESS
+ Informational = 0x1 : STATUS_SEVERITY_INFORMATIONAL
+ Warning = 0x2 : STATUS_SEVERITY_WARNING
+ Error = 0x3 : STATUS_SEVERITY_ERROR
+)
+
+;// facility names
+FacilityNames = (
+ System = 0x0FF
+ Application = 0xFFF
+)
+
+EOF
+
+print <<EOF;
+
+;// event messages from here
+
+MessageIdTypedef = DWORD
+
+EOF
+
+print <<EOF;
+MessageId = 0x100
+Severity = Error
+Facility = Application
+SymbolicName = WOLF_TEST_NO_PARAMS
+Language = English
+This is a test message without any parameters
+It can be two lines though
+.
+
+MessageId = 0x101
+Severity = Error
+Facility = Application
+SymbolicName = WOLF_TEST_PARAMS
+Language = English
+This is a message with parameter %1 and parameter %2
+.
+EOF
diff --git a/src/log/wolfmsg.mc b/src/log/wolfmsg.mc
index 3aad1ab..ad7003d 100644
--- a/src/log/wolfmsg.mc
+++ b/src/log/wolfmsg.mc
@@ -2,8 +2,10 @@
;// language codes for translated messages
;// (409 ist the windows locale for en-US)
+;// (see http://msdn.microsoft.com/en-us/library/ms776260.aspx)
LanguageNames = (
- English = 0x409 : MSG00409
+ English = 0x0409 : MSG00409
+ German = 0x0407 : MSG00407
)
;// Category names come first, the 'CategoryCount' registry entry
@@ -17,15 +19,23 @@ LanguageNames = (
MessageId = 0x1
SymbolicName = WOLF_CATEGORY_1
Language = English
-Category 1
+Logger
+.
+Language = German
+Logger
.
MessageId = 0x2
SymbolicName = WOLF_CATEGORY_2
Language = English
-Category 2
+Dameon
+.
+Language = German
+Unix-Prozess
.
+# constants things defined by the event logger (advapi32.dll)
+
;// event log severity levels (severity bits)
SeverityNames = (
Success = 0x0 : STATUS_SEVERITY_SUCCESS
@@ -41,7 +51,6 @@ FacilityNames = (
)
-
;// event messages from here
MessageIdTypedef = DWORD