summaryrefslogtreecommitdiff
path: root/tests/log
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-03-26 13:58:21 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-03-26 13:58:21 +0100
commit98b866b0acbce85138c1ceffa0ee0f458e6f76db (patch)
tree5d7d984c58fe0a3bc5cdc11633c44a82f43627d5 /tests/log
parentbe1a632d7716b7a915a1b3447287fcfc604fb1c7 (diff)
downloadwolfbones-98b866b0acbce85138c1ceffa0ee0f458e6f76db.tar.gz
wolfbones-98b866b0acbce85138c1ceffa0ee0f458e6f76db.tar.bz2
added a logging feedback form test, really nice feature!
Diffstat (limited to 'tests/log')
-rw-r--r--tests/log/test_log.c16
-rw-r--r--tests/log/testmsg.mc9
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/log/test_log.c b/tests/log/test_log.c
index cfe052d..a1352d6 100644
--- a/tests/log/test_log.c
+++ b/tests/log/test_log.c
@@ -21,6 +21,7 @@
#define WOLF_MSG_TEST_LOG_MSG6 WOLF_MSG_TEST_LOG_BASE+6
#define WOLF_MSG_TEST_LOG_MSG7 WOLF_MSG_TEST_LOG_BASE+7
#define WOLF_MSG_TEST_LOG_MSG8 WOLF_MSG_TEST_LOG_BASE+8
+#define WOLF_MSG_TEST_LOG_MSG9 WOLF_MSG_TEST_LOG_BASE+9
int main( void ) {
char errbuf[512];
@@ -39,6 +40,8 @@ int main( void ) {
"C:\\Temp\\testmsg.dll", 3, WOLF_LOG_NOTICE );
#endif
+ /* parameters and levels */
+
wolf_log( WOLF_LOG_ERR, WOLF_CATEGORY_TEST_LOG, WOLF_MSG_TEST_LOG_MSG1,
"This is error %d", 5 );
wolf_log( WOLF_LOG_WARNING, WOLF_CATEGORY_TEST_LOG, WOLF_MSG_TEST_LOG_MSG2,
@@ -53,6 +56,8 @@ int main( void ) {
wolf_log( WOLF_LOG_ERR, WOLF_CATEGORY_TEST_LOG, WOLF_MSG_TEST_LOG_MSG6,
"This is error %d with %s", 5, "foobar" );
+ /* different ways of handling system errors (errno, GetLastError) */
+
errno = 5;
(void)strerror_r( errno, errbuf, 512 );
wolf_log( WOLF_LOG_ERR, WOLF_CATEGORY_TEST_LOG, WOLF_MSG_TEST_LOG_MSG7,
@@ -67,6 +72,17 @@ int main( void ) {
errbuf, GetLastError( ) );
#endif
+ /* HTTP link to a knowledge base or feedback form, this results in a
+ * HTTP GET request to the address:
+ *
+ * http://wolfbones.andreasbaumann.cc/?EvtSrc=wolf_log_test&EvtCat=Test%20Category%20&EvtID=3009
+ *
+ * Really good thinking here!
+ */
+ wolf_log( WOLF_LOG_ERR, WOLF_CATEGORY_TEST_LOG, WOLF_MSG_TEST_LOG_MSG9,
+ "Error %d, see more on http://wolfbones.andreasbaumann.cc",
+ 66 );
+
#if defined WOLF_LOG_HAVE_EVENTLOG
wolf_log_closelogtoeventlog( );
#endif
diff --git a/tests/log/testmsg.mc b/tests/log/testmsg.mc
index 4deb4d9..84be6ee 100644
--- a/tests/log/testmsg.mc
+++ b/tests/log/testmsg.mc
@@ -115,3 +115,12 @@ SymbolicName = WOLF_MSG_TEST_LOG_MSG8
Language = English
A Windows error occured during %1 phase: %2 (%3)
.
+
+MessageId = 3009
+Severity = Error
+Facility = Application
+SymbolicName = WOLF_MSG_TEST_LOG_MSG9
+Language = English
+Error %1, see more on http://wolfbones.andreasbaumann.cc
+.
+