Loggers.cpp
Go to the documentation of this file.
00001 #include "../utest.h"
00002 
00003 using namespace std;
00004 using namespace PointMatcherSupport;
00005 
00006 //---------------------------
00007 // Loggers
00008 //---------------------------
00009 
00010 //TODO: FileLogger
00011 //Log using std::stream.
00012 //- infoFileName (default: /dev/stdout) - name of the file to output infos to
00013 //- warningFileName (default: /dev/stderr) - name of the file to output warnings to
00014 //- displayLocation (default: 0) - display the location of message in source code
00015 TEST(Loggers, FileLogger)
00016 {
00017         string infoFileName = "utest_info";
00018         string warningFileName = "utest_warn";
00019 
00020         Logger* fileLog = 
00021                 PM::get().REG(Logger).create(
00022                         "FileLogger", map_list_of
00023                                 ("infoFileName", infoFileName)
00024                                 ("warningFileName", warningFileName)
00025                                 ("displayLocation", "1")
00026                 )
00027         ;
00028         //TODO: we only test constructor here, check other things...
00029 
00030         delete fileLog;
00031 
00032         // Remove file from disk
00033         EXPECT_TRUE(boost::filesystem::remove(boost::filesystem::path(infoFileName)));
00034         EXPECT_TRUE(boost::filesystem::remove(boost::filesystem::path(warningFileName)));
00035 }


libpointmatcher
Author(s):
autogenerated on Mon Sep 14 2015 02:59:06