//============================================================================== // // Copyright (C) 2004 Dick van Oudheusden // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this library; if not, write to the Free // Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // //============================================================================== // // $Date: 2005/01/30 08:05:48 $ $Revision: 1.2 $ // //============================================================================== #include "ofc/DLog.h" #include "ofc/DSystemLogger.h" #include "ofc/DTimer.h" #include "DTest.h" //-Compound-------------------------------------------------------------------- void DSystemLogger_test() { #ifdef HAVE_DSYSTEMLOGGER DSystemLogger *syslogger = [DSystemLogger alloc]; int i; STARTTEST(); [syslogger init :"ofc" :NO]; dlogger(syslogger); dlog(DLOG_PANIC, "Panic level"); dlog(DLOG_ALERT, "Alert level:%d", 120); // Repeated message for (i = 0; i <2500; i++) { dlog(DLOG_CRITICAL, "Critical level"); } dlog(DLOG_ERROR, "Error level"); dlog(DLOG_WARNING, "Warning level"); dlog(DLOG_NOTICE, "Info level"); dlog(DLOG_DEBUG, "Debug level"); dlogmask(DLOG_ALERT|DLOG_CRITICAL|DLOG_WARNING|DLOG_DEBUG); dlog(DLOG_PANIC, "Bit-Masked panic level"); dlog(DLOG_ALERT, "Bit-Masked alert level:%d", 120); dlog(DLOG_CRITICAL, "Bit-Masked critical level"); dlog(DLOG_ERROR, "Bit-Masked error level"); dlog(DLOG_WARNING, "Bit-Masked warning level"); dlog(DLOG_NOTICE, "Bit-Masked info level"); dlog(DLOG_DEBUG, "Bit-Masked debug level"); dlogrange(DLOG_ALERT,DLOG_INFO); dlog(DLOG_PANIC, "Range-Masked panic level"); dlog(DLOG_ALERT, "Range-Masked alert level:%d", 120); dlog(DLOG_CRITICAL, "Range-Masked critical level"); dlog(DLOG_ERROR, "Range-Masked error level"); dlog(DLOG_WARNING, "Range-Masked warning level"); dlog(DLOG_NOTICE, "Range-Masked info level"); dlog(DLOG_DEBUG, "Range-Masked debug level"); dlogger(nil); STOPTEST(); [syslogger free]; #endif }