From 12d314225a97f1241a8b5d9eaf8cb8f49be1010d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 13 Nov 2003 02:59:09 +0000 Subject: [PATCH] Fixed the test; I wanted to use setlogmask_team() there... Added tests for the repeated message suppressing. Added test for having no ident string. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5344 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/kernel/libroot/posix/SyslogTest.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tests/kernel/libroot/posix/SyslogTest.cpp b/src/tests/kernel/libroot/posix/SyslogTest.cpp index 26cc7a2918..616126eda0 100644 --- a/src/tests/kernel/libroot/posix/SyslogTest.cpp +++ b/src/tests/kernel/libroot/posix/SyslogTest.cpp @@ -30,13 +30,17 @@ main(int argc, char **argv) log_team(LOG_WARNING, "this is a warning (hidden)"); log_team(LOG_CRIT, "this is a critical condition (visible)"); - setlogmask(mask); + setlogmask_team(mask); syslog(LOG_WARNING, "thread warning (visible)"); syslog(LOG_CRIT, "thread critical condition (visible)"); + syslog(LOG_CRIT, "thread critical condition (visible)"); setlogmask(LOG_MASK(LOG_WARNING)); log_team(LOG_WARNING | LOG_MAIL, "2. this is a warning from the MAIL facility (visible)"); log_team(LOG_CRIT, "2. this is a critical condition (visible)"); + log_team(LOG_CRIT, "2. this is a critical condition (visible)"); + log_team(LOG_CRIT, "2. this is a critical condition (visible)"); + // test repeat message suppressing as well openlog(NULL, LOG_PERROR, LOG_USER); syslog(LOG_WARNING, "thread/perror warning (visible in stderr as well)"); @@ -45,6 +49,9 @@ main(int argc, char **argv) openlog(NULL, LOG_CONS | LOG_PID, LOG_DAEMON); syslog(LOG_WARNING, "thread/cons warning (visible in stderr only when there is no syslog_daemon)"); + openlog("", 0, LOG_DAEMON); + syslog(LOG_WARNING, "thread warning without ident (visible)"); + setlogmask(LOG_EMERG); closelog(); // this should inherit the team log context on next logging entry