testPriority.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include "log4cpp/Priority.hh"
3 
4 using namespace log4cpp;
5 
6 int main(int argc, char** argv) {
7 
8  std::cout << "priority debug(700): " << Priority::getPriorityName(700) << std::endl;
9  std::cout << "priority debug(700): " << Priority::getPriorityValue("DEBUG") << std::endl;
10  std::cout << "priority debug(700): " << Priority::getPriorityValue("700") << std::endl;
11  try {
12  std::cout << "priority debug(700): " << Priority::getPriorityValue("700arghh") << std::endl;
13  } catch(std::invalid_argument& e) {
14  std::cout << "caught " << e.what() << std::endl;
15  }
16  return 0;
17 }
int main(int argc, char **argv)
Definition: testPriority.cpp:6
static const std::string & getPriorityName(int priority)
Definition: Priority.cpp:37
static Value getPriorityValue(const std::string &priorityName)
Definition: Priority.cpp:44


log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Jun 23 2019 19:14:17