comparison OrthancServer/main.cpp @ 1490:596927722403

support of --logdir by the internal logger
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Aug 2015 14:04:48 +0200
parents 1389834e130f
children 4f8c8ef114db
comparison
equal deleted inserted replaced
1489:1389834e130f 1490:596927722403
650 Logging::EnableTraceLevel(true); 650 Logging::EnableTraceLevel(true);
651 } 651 }
652 652
653 if (boost::starts_with(argv[i], "--logdir=")) 653 if (boost::starts_with(argv[i], "--logdir="))
654 { 654 {
655 Logging::SetTargetFolder(std::string(argv[i]).substr(9)); 655 std::string directory = std::string(argv[i]).substr(9);
656
657 try
658 {
659 Logging::SetTargetFolder(directory);
660 }
661 catch (OrthancException&)
662 {
663 fprintf(stderr, "The directory where to store the log files (%s) is inexistent, aborting.\n", directory.c_str());
664 return -1;
665 }
656 } 666 }
657 667
658 if (boost::starts_with(argv[i], "--config=")) 668 if (boost::starts_with(argv[i], "--config="))
659 { 669 {
660 std::string configurationSample; 670 std::string configurationSample;