14 const char* stringFormat,
18 va_start(va, stringFormat);
19 category.
logva(priority, stringFormat, va);
30 if ((tmpAppender == appender) ||
31 (tmpAppender == appender2) ||
32 (tmpAppender == &appender3))
34 std::cout <<
"tmpAppender == appender or appender2 or appender3" << std::endl;
38 std::cout <<
"tmpAppender != appender or appender2 or appender3" << std::endl;
43 if (tmpAppender == appender2)
45 std::cout <<
"tmpAppender == appender2" << std::endl;
49 std::cout <<
"tmpAppender != appender2" << std::endl;
53 if (tmpAppender == &appender3)
55 std::cout <<
"tmpAppender == appender3" << std::endl;
59 std::cout <<
"tmpAppender != appender3" << std::endl;
94 std::cout <<
"You should see three lines of \"root error #1\"" << std::endl;
95 root.
error(
"root error #1");
96 std::cout <<
"Did you?" << std::endl;
99 std::cout <<
"You should see messages that tmpAppender == other appenders" << std::endl;
101 std::cout <<
"Did you?" << std::endl;
113 std::cout <<
"You should not see any lines of \"root error #2\"" << std::endl;
114 root.
error(
"root error #2");
115 std::cout <<
"Did you?" << std::endl;
118 std::cout <<
"You should see messages that tmpAppender != other appenders" << std::endl;
120 std::cout <<
"Did you?" << std::endl;
138 int main(
int argc,
char** argv) {
166 std::cout <<
" root priority = " << root.
getPriority() << std::endl;
167 std::cout <<
" sub1 priority = " << sub1.
getPriority() << std::endl;
168 std::cout <<
" sub2 priority = " << sub2.
getPriority() << std::endl;
170 root.
error(
"root error");
171 root.
warn(
"root warn");
172 sub1.
error(
"sub1 error");
173 sub1.
warn(
"sub1 warn");
174 sub2.
error(
"sub2 error");
175 sub2.
warn(
"sub2 warn");
186 char lengthy1[] =
"Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. Test for variable-arguments lists overflow. ";
190 std::cout <<
" root priority = " << root.
getPriority() << std::endl;
191 std::cout <<
" sub1 priority = " << sub1.
getPriority() << std::endl;
192 std::cout <<
" sub2 priority = " << sub2.
getPriority() << std::endl;
194 std::cout <<
"priority info" << std::endl;
195 root.
error(
"root error");
196 root.
warn(
"root warn");
197 sub1.
error(
"sub1 error");
198 sub1.
warn(
"sub1 warn");
199 sub2.
error(
"sub2 error");
200 sub2.
warn(
"sub2 warn");
201 sub2.
error(
"%s %s %d",
"test",
"vform", 123);
CategoryStream warnStream()
void warn(const char *stringFormat,...)
LOG4CPP_EXPORT CategoryStream & eol(CategoryStream &os)
virtual Appender * getAppender() const
virtual void setAdditivity(bool additivity)
void testLogva(log4cpp::Category &category, log4cpp::Priority::Value priority, const char *stringFormat,...)
static Category & getInstance(const std::string &name)
void testGetAppender(log4cpp::Category &category, log4cpp::Appender *appender, log4cpp::Appender *appender2, log4cpp::Appender &appender3)
virtual void logva(Priority::Value priority, const char *stringFormat, va_list va)
int main(int argc, char **argv)
virtual void removeAllAppenders()
static Category & getRoot()
virtual void removeAppender(Appender *appender)
virtual Priority::Value getPriority() const
virtual void setPriority(Priority::Value priority)
virtual void setLayout(Layout *layout=NULL)
virtual void addAppender(Appender *appender)
void error(const char *stringFormat,...)
void testMultiAppenders()
virtual void setLayout(Layout *layout)=0