PropertyConfigurator.hh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * SimpleConfigurator.hh
  3. *
  4. * Copyright 2001, Glen Scott. All rights reserved.
  5. *
  6. * See the COPYING file for the terms of usage and distribution.
  7. */
  8. #ifndef _LOG4CPP_PROPERTYCONFIGURATOR_HH
  9. #define _LOG4CPP_PROPERTYCONFIGURATOR_HH
  10. #include "Base/GCException.h"
  11. #include <log4cpp/Portability.hh>
  12. #include <log4cpp/Export.hh>
  13. #include <string>
  14. #include <log4cpp/Configurator.hh> // configure exceptions
  15. LOG4CPP_NS_BEGIN
  16. /**
  17. Property configurator will read a config file using the same (or similar)
  18. format to the config file used by log4j. This file is in a standard Java
  19. "properties" file format.
  20. <P>Example:<BR>
  21. <PRE>
  22. # a simple test config
  23. log4j.rootCategory=DEBUG, rootAppender
  24. log4j.category.sub1=A1
  25. log4j.category.sub2=INFO
  26. log4j.category.sub1.sub2=ERROR, A2
  27. log4j.appender.rootAppender=org.apache.log4j.ConsoleAppender
  28. log4j.appender.rootAppender.layout=org.apache.log4j.BasicLayout
  29. log4j.appender.A1=org.apache.log4j.FileAppender
  30. log4j.appender.A1.fileName=A1.log
  31. log4j.appender.A1.layout=org.apache.log4j.BasicLayout
  32. log4j.appender.A2=org.apache.log4j.ConsoleAppender
  33. log4j.appender.A2.layout=org.apache.log4j.PatternLayout
  34. log4j.appender.A2.layout.ConversionPattern=The message %%m at time %%d%%n
  35. </PRE>
  36. @since 0.3.2
  37. **/
  38. class LOG4CPP_EXPORT PropertyConfigurator {
  39. public:
  40. static void configure(const std::string& initFileName);
  41. // throw(GenICam::InvalidArgumentException);
  42. static void configure(std::istream& initStream);
  43. // throw(GenICam::InvalidArgumentException);
  44. };
  45. LOG4CPP_NS_END
  46. #endif // _LOG4CPP_PROPERTYCONFIGURATOR_HH