SimpleConfigurator.hh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_SIMPLECONFIGURATOR_HH
  9. #define _LOG4CPP_SIMPLECONFIGURATOR_HH
  10. #include <log4cpp/Portability.hh>
  11. #include <iostream>
  12. #include <string>
  13. #include <log4cpp/Configurator.hh>
  14. namespace log4cpp {
  15. /**
  16. * This class implements a simple Configurator for log4cpp.
  17. * It is a temporary hack with an undocumented configuration format.
  18. * @deprecated As of version 0.3.2 log4cpp includes a log4j format
  19. * compatible PropertyConfigurator, removing the need for
  20. * SimpleConfigurator. This class will be removed in 0.4.0.
  21. **/
  22. class LOG4CPP_EXPORT SimpleConfigurator {
  23. public:
  24. /**
  25. * Configure log4cpp with the configuration in the given file.
  26. * NB. The configuration file format is undocumented and may change
  27. * without notice.
  28. * @since 0.2.6
  29. * @param initFileName name of the configuration file
  30. * @exception ConfigureFailure if the method encountered a read or
  31. * syntax error.
  32. **/
  33. static void configure(const std::string& initFileName);
  34. /**
  35. * Configure log4cpp with the configuration in the given file.
  36. * NB. The configuration file format is undocumented and may change
  37. * without notice.
  38. * @since 0.3.1
  39. * @param initFile an input stream to the configuration file
  40. * @exception ConfigureFailure if the method encountered a read or
  41. * syntax error.
  42. **/
  43. static void configure(std::istream& initFile);
  44. };
  45. }
  46. #endif