Author: mcalmer
Date: Sat Jul 17 18:38:59 2010
New Revision: 2689
URL: http://svn.opensuse.org/viewcvs/limal?rev=2689&view=rev
Log:
- replace blocxx::Logger with own implementaion
- adapt testcases to the new Logger
Added:
limal-branches/mc-devel/limal-ca-mgm/src/LogControl.cpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/LogControl.hpp
Removed:
limal-branches/mc-devel/limal-ca-mgm/src/Logger.cpp
Modified:
limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.cpp
limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.h
limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.cpp
limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.h
limal-branches/mc-devel/limal-ca-mgm/src/Makefile.am
limal-branches/mc-devel/limal-ca-mgm/src/Utils.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/Logger.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/Makefile.am
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA1.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA2.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA3.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA4.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase1.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase2.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase3.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase1.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase2.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase3.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA7.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA7/testcase1.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA8.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA9.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CAConfig.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CRLTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest2.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest3.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest4.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest5.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest6.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ConvertTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/DeleteCATest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ExportTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/IPv6CheckTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ImportCATest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ImportCommonCertificateTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ImportRequestTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ListCATreeTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ListTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCATest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCRLTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCertificateTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCertificateTest2.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseRequestTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RemoveCertificateTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RemoveRequestTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RequestTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RevokeTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RevokeTest2.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RevokeTest3.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RevokeTest4.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RevokeTest5.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/SubCATest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA1/cam.txt
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA1/index.txt
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/.rand
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/crl/crl.pem
limal-branches/mc-devel/limal-ca-mgm/testsuite/UpdateDBTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/VerifyTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/iniParser.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/iniParser/chg1.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/iniParser/comment.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/iniParser/delete.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/iniParser/read1.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/iniParser/select1.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/iniParser/wr_add.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/iniParser/wr_chg.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/CA1.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/CAConfig.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/ConvertTest.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/ImportCATest.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/ListTest.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/VerifyTest.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/sysConfig.err
limal-branches/mc-devel/limal-ca-mgm/testsuite/sysConfig.cc
Modified: limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.cpp?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.cpp Sat Jul 17 18:38:59 2010
@@ -115,7 +115,7 @@
IniSectionIdxIterator v = isections.find(k);
if (v == isections.end ())
{
- LIMAL_SLOG_ERROR (logger, "Internal error. Section " << k.c_str() << " not found. This can't happen." );
+ ERR << "Internal error. Section " << k.c_str() << " not found. This can't happen." << std::endl;
abort();
}
IniSection &s = v->second->s ();
@@ -139,7 +139,7 @@
isections.equal_range (k);
if (r.first == r.second) // empty range = not found
{
- LIMAL_SLOG_ERROR (logger, "Internal error. Value " << path[from].c_str() << " not found. This can't happen." );
+ ERR << "Internal error. Value " << path[from].c_str() << " not found. This can't happen." << std::endl;
abort ();
}
IniSection& s = (--r.second)->second->s ();
@@ -264,7 +264,7 @@
}
// empty range, no such key
- LIMAL_SLOG_DEBUG (logger, "Read: Invalid path" << pathToString(p).c_str() << "[" << depth <<"]");
+ DBG << "Read: Invalid path" << pathToString(p).c_str() << "[" << depth <<"]" << std::endl;
return -1;
}
@@ -287,7 +287,7 @@
return getMyValue (p, out, what, depth);
}
- LIMAL_SLOG_DEBUG (logger, "Read: Invalid path" << pathToString (p).c_str() << "[" << depth <<"]");
+ DBG << "Read: Invalid path" << pathToString (p).c_str() << "[" << depth <<"]" << std::endl;
return -1;
}
@@ -355,7 +355,7 @@
// empty range, no such key
}
- LIMAL_SLOG_DEBUG (logger, "Read: Invalid path " << pathToString (p).c_str() << "[" << depth <<"]");
+ DBG << "Read: Invalid path " << pathToString (p).c_str() << "[" << depth <<"]" << std::endl;
return -1;
}
@@ -379,7 +379,7 @@
return 0;
}
- LIMAL_SLOG_ERROR (logger, "Read: Invalid path " << pathToString (p).c_str() << "[" << depth <<"]");
+ ERR << "Read: Invalid path " << pathToString (p).c_str() << "[" << depth <<"]" << std::endl;
return -1;
}
@@ -421,7 +421,7 @@
return delValueFlat (p);
if (p.size() < 2)
{
- LIMAL_SLOG_ERROR (logger, "I do not know what to delete at " << pathToString(p).c_str());
+ ERR << "I do not know what to delete at " << pathToString(p).c_str() << std::endl;
return -1;
}
std::string s (p[0]);
@@ -439,7 +439,7 @@
if (p.size() < 2)
{
- LIMAL_SLOG_ERROR (logger, "I do not know what to write to " << pathToString(p).c_str());
+ ERR << "I do not know what to write to " << pathToString(p).c_str() << std::endl;
return -1;
}
std::string s (p[0]);
@@ -475,7 +475,7 @@
if (xi == xe)
{
// not found, need to add it;
- LIMAL_SLOG_DEBUG (logger, "Write: adding recursively "<< k.c_str () << " to " << pathToString(p).c_str());
+ DBG << "Write: adding recursively "<< k.c_str () << " to " << pathToString(p).c_str() << std::endl;
IniSection s (ip, k);
container.push_back (IniContainerElement (s));
@@ -519,7 +519,7 @@
if (xi == xe)
{
///need to add a section ...
- LIMAL_SLOG_DEBUG (logger, "Adding section " << pathToString(p).c_str());
+ DBG << "Adding section " << pathToString(p).c_str() << std::endl;
// prepare it to have its property set
// create it
IniSection s (ip, k);
@@ -585,7 +585,7 @@
return s.delSection (p, depth+1);
}
//error
- LIMAL_SLOG_ERROR (logger, "Delete: Invalid path" << pathToString(p).c_str() << "[" << depth << "]");
+ ERR << "Delete: Invalid path" << pathToString(p).c_str() << "[" << depth << "]" << std::endl;
return -1;
}
else
@@ -593,7 +593,7 @@
// bottom level, massacre begins
if (xi == xe)
{
- LIMAL_SLOG_DEBUG (logger, "Can not delete " << pathToString(p).c_str() <<". Key does not exist." );
+ DBG << "Can not delete " << pathToString(p).c_str() <<". Key does not exist." << std::endl;
}
while (xi != xe)
{
@@ -605,7 +605,7 @@
int IniSection::WriteAll (const std::vectorstd::string&p, const SectionAll& in, int depth)
{
- LIMAL_SLOG_INFO (logger, "This function has not been tested cause it is not needed at the moment.");
+ INF << "This function has not been tested cause it is not needed at the moment." << std::endl;
if (depth < int(p.size ()))
{
// recurse to find the starting section
@@ -623,7 +623,7 @@
return setAllDoIt (in);
}
- LIMAL_SLOG_DEBUG (logger, "Read: Invalid path" << pathToString (p).c_str() << "[" << depth <<"]");
+ DBG << "Read: Invalid path" << pathToString (p).c_str() << "[" << depth <<"]" << std::endl;
return -1;
}
@@ -638,7 +638,7 @@
std::string kind = in.kind;
if (kind != "section")
{
- LIMAL_SLOG_ERROR (logger, "Kind should be 'section'");
+ ERR << "Kind should be 'section'" << std::endl;
return -1;
}
@@ -676,7 +676,7 @@
}
else
{
- LIMAL_SLOG_ERROR (logger, "Item in Write (.all) of unrecognized kind " << kind.c_str ());
+ ERR << "Item in Write (.all) of unrecognized kind " << kind.c_str () << std::endl;
ret = -1;
break;
}
@@ -718,13 +718,13 @@
if (xi == xe)
{
///need to add a value ...
- LIMAL_SLOG_DEBUG (logger, "Adding value " <<
+ DBG << "Adding value " <<
pathToString (p).c_str() << "=" <<
- prop.c_str ());
+ prop.c_str () << std::endl;
if (what)
{
- LIMAL_SLOG_ERROR (logger, "You must add value before changing comment/type. " <<
- pathToString (p).c_str ());
+ ERR << "You must add value before changing comment/type. " <<
+ pathToString (p).c_str () << std::endl;
return -1;
}
// prepare it to have its property set
@@ -783,7 +783,7 @@
if (xi == xe)
{
// not found, need to add it;
- LIMAL_SLOG_DEBUG (logger, "Write: adding recursively " << k.c_str () << " to " << pathToString(p).c_str());
+ DBG << "Write: adding recursively " << k.c_str () << " to " << pathToString(p).c_str() << std::endl;
IniSection s (ip, k);
container.push_back (IniContainerElement (s));
@@ -821,7 +821,7 @@
if (xi == xe)
{
- LIMAL_SLOG_DEBUG ( logger, "Can not delete " << k.c_str() << " Key does not exist." );
+ DBG << "Can not delete " << k.c_str() << " Key does not exist." << std::endl;
}
while (xi != xe)
{
@@ -850,7 +850,7 @@
return s.delValue (p, depth+1);
}
//error
- LIMAL_SLOG_ERROR (logger, "Delete: Invalid path "<< pathToString (p).c_str() << "[" << depth <<"]");
+ ERR << "Delete: Invalid path "<< pathToString (p).c_str() << "[" << depth <<"]" << std::endl;
return -1;
}
else
@@ -929,7 +929,7 @@
if (p.size()<2)
{
- LIMAL_SLOG_ERROR (logger, "I do not know what to read from " << pathToString(p).c_str());
+ ERR << "I do not know what to read from " << pathToString(p).c_str() << std::endl;
return -1;
}
std::string s (p[0]);
@@ -944,13 +944,13 @@
else if (s == "st" || s == "section_type" || s == "sectiontype")
return getSectionProp (p, out, rewrite? 1:2, 1);
- LIMAL_SLOG_ERROR (logger, "I do not know what to read from " << pathToString(p).c_str());
+ ERR << "I do not know what to read from " << pathToString(p).c_str() << std::endl;
return -1;
}
int IniSection::ReadAll (const std::vectorstd::string&p, SectionAll&out)
{
- LIMAL_SLOG_INFO (logger, "This function has not been tested cause it is not needed at the moment.");
+ INF << "This function has not been tested cause it is not needed at the moment." << std::endl;
if (p.size() >= 1 && p[0] == "all")
{
return getAll (p, out, 1);
@@ -967,7 +967,7 @@
return dirValueFlat (p, l);
if (p.size()<1)
{
- LIMAL_SLOG_ERROR (logger, "I do not know what to dir from "<< pathToString(p).c_str());
+ ERR << "I do not know what to dir from "<< pathToString(p).c_str() << std::endl;
return -1;
}
@@ -977,7 +977,7 @@
else if (s == "s" || s == "section")
return dirHelper (p, l, 1, 1);
- LIMAL_SLOG_ERROR (logger, "I do not know what to dir from "<< pathToString(p).c_str());
+ ERR << "I do not know what to dir from "<< pathToString(p).c_str() << std::endl;
return -1;
}
int IniSection::dirHelper (const std::vectorstd::string&p, StringList&out,int get_sect,int depth)
@@ -1001,7 +1001,7 @@
return s.dirHelper (p, out, get_sect, depth+1);
}
//error
- LIMAL_SLOG_DEBUG (logger, "Dir: Invalid path "<< pathToString (p).c_str() << "[" << depth <<"]");
+ DBG << "Dir: Invalid path "<< pathToString (p).c_str() << "[" << depth <<"]" << std::endl;
return -1;
}
@@ -1011,8 +1011,8 @@
IniEntryMapIterator i = values.find(n);
if (i == values.end())
{
- LIMAL_SLOG_ERROR (logger, "Internal error. Value " << n << " not found in section " << name.c_str());
- abort();
+ ERR << "Internal error. Value " << n << " not found in section " << name.c_str();
+ abort() << std::endl;
}
return (*i).second;
}
@@ -1039,7 +1039,7 @@
if (xi == xe)
{
- LIMAL_SLOG_ERROR (logger, "Internal error. Section " << n << " not found in section " << name.c_str());
+ ERR << "Internal error. Section " << n << " not found in section " << name.c_str() << std::endl;
abort();
}
return (--xe)->second->s ();
Modified: limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.h
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.h?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.h (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.h Sat Jul 17 18:38:59 2010
@@ -14,6 +14,8 @@
#ifndef IniFile_h
#define IniFile_h
+#define LIMAL_LOGGER_LOGGROUP "IniParser"
+
#include
#include
#include
@@ -22,7 +24,7 @@
#include <map>
#include <vector>
-#define INIPARSER "IniParser"
+//#define INIPARSER "IniParser"
namespace LIMAL_NAMESPACE
{
@@ -261,7 +263,7 @@
IniSectionIndex isections;
// create Logger instance
- Logger logger;
+ //Logger logger;
/** build ivalues and isections */
void reindex ();
@@ -434,15 +436,16 @@
// IniSection ();
public:
/** explicit uninitialized constructor */
- IniSection (const char *u): IniBase (u),
- logger(INIPARSER) {}
+ IniSection (const char *u): IniBase (u)
+ //, logger(INIPARSER)
+ {}
IniSection (const blocxx::IntrusiveReference<IniParser> &p)
: IniBase (-1),
ip (p),
end_comment (), rewrite_by(-1),
- container (), ivalues (), isections (),
- logger(INIPARSER)
+ container (), ivalues (), isections ()
+ //,logger(INIPARSER)
{}
/**
@@ -453,8 +456,8 @@
IniBase (s),
ip (s.ip),
end_comment (s.end_comment), rewrite_by (s.rewrite_by),
- container (s.container),
- logger("IniParser")
+ container (s.container)
+ // , logger("IniParser")
{ reindex (); }
void operator = (const IniSection &s)
Modified: limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.cpp?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.cpp Sat Jul 17 18:38:59 2010
@@ -127,13 +127,13 @@
COMPARE_OPTION (no_finalcomment_kill)
COMPARE_OPTION (read_only)
COMPARE_OPTION (flat)
- LIMAL_SLOG_ERROR (logger,"Option not implemented yet:"<< sv.c_str());
+ ERR <<"Option not implemented yet:"<< sv.c_str() << std::endl;
#undef COMPARE_OPTION
}
if (ignore_case && multiple_files)
{
- LIMAL_SLOG_ERROR (logger, "When using multiple files, ignore_case does not work");
+ ERR << "When using multiple files, ignore_case does not work" << std::endl;
ignore_case = false;
}
}
@@ -233,15 +233,15 @@
if (!pa.end.compile (entry.multiEnd,
REG_EXTENDED | (ignore_case ? REG_ICASE : 0)))
{
- LIMAL_SLOG_ERROR (logger,"Bad regexp(multiline): "<<
- entry.multiEnd.c_str());
+ ERR <<"Bad regexp(multiline): "<<
+ entry.multiEnd.c_str() << std::endl;
pa.multiline_valid = false;
}
}
else
{
- LIMAL_SLOG_ERROR (logger,"Bad regexp(multiline): "<<
- entry.multiBegin.c_str());
+ ERR <<"Bad regexp(multiline): "<<
+ entry.multiBegin.c_str() << std::endl;
}
}
@@ -250,8 +250,8 @@
{
if (pa.multiline_valid)
{
- LIMAL_SLOG_ERROR (logger,"Bad regexp(match): "<<
- entry.line.regExpr.c_str());
+ ERR <<"Bad regexp(match): "<<
+ entry.line.regExpr.c_str() << std::endl;
}
break;
}
@@ -298,7 +298,7 @@
}
#define scanner_error(format,args...) \
- LIMAL_LOG_ERROR (logger, str::form( "%s:%d " format, scanner_file.c_str (), scanner_line, ##args).c_str())
+ ERR << str::form( "%s:%d " format, scanner_file.c_str (), scanner_line, ##args).c_str() << std::endl
void StripLine (std::string&l, regmatch_t&r)
{
@@ -345,7 +345,7 @@
{
if ( !started)
{
- LIMAL_SLOG_ERROR (logger,"Parser not initialized");
+ ERR <<"Parser not initialized" << std::endl;
return -1;
}
@@ -373,7 +373,7 @@
{
section_index = j;
section_name = m[1];
- LIMAL_SLOG_DEBUG (logger, "Rewriting " << *f << " to " << section_name.c_str());
+ DBG << "Rewriting " << *f << " to " << section_name.c_str() << std::endl;
break;
}
}
@@ -384,7 +384,7 @@
{
// new file
if (scanner_start (*f))
- LIMAL_SLOG_ERROR (logger,"Cannot open " << *f);
+ ERR <<"Cannot open " << *f << std::endl;
else
{
FileDescr fdsc (*f);
@@ -399,10 +399,10 @@
if ((*ff).second.changed ())
{
if (scanner_start (*f))
- LIMAL_SLOG_ERROR (logger,"Cannot open " << *f);
+ ERR <<"Cannot open " << *f << std::endl;
else
{
- LIMAL_SLOG_DEBUG (logger, "File " << *f << " changed. Reloading.");
+ DBG << "File " << *f << " changed. Reloading." << std::endl;
FileDescr fdsc (*f);
multi_files [*f] = fdsc;
inifile.initSection (section_name, "", -1, section_index);
@@ -417,7 +417,7 @@
{
if (scanner_start (file.c_str()))
{
- LIMAL_SLOG_ERROR (logger,"Can not open " << file.c_str());
+ ERR <<"Can not open " << file.c_str() << std::endl;
return -1;
}
parse_helper(inifile);
@@ -751,7 +751,7 @@
// Therefore we do not reparse.
if (repeat_names)
{
- LIMAL_SLOG_DEBUG (logger, "Skipping possible reparse due to repeat_names");
+ DBG << "Skipping possible reparse due to repeat_names" << std::endl;
return;
}
if (multiple_files)
@@ -760,7 +760,7 @@
{
if (timestamp != getTimeStamp())
{
- LIMAL_SLOG_ERROR (logger, "Data file '" << file.c_str() << "' was changed externaly!");
+ ERR << "Data file '" << file.c_str() << "' was changed externaly!" << std::endl;
parse ();
}
}
@@ -777,7 +777,7 @@
}
if (stat(file.c_str(), &st))
{
- LIMAL_SLOG_ERROR (logger, "Unable to stat '" << file.c_str() << "': " << strerror(errno));
+ ERR << "Unable to stat '" << file.c_str() << "': " << strerror(errno) << std::endl;
return 0;
}
return st.st_mtime;
@@ -786,7 +786,7 @@
{
if ( !started)
{
- LIMAL_SLOG_ERROR (logger,"Parser not initialized");
+ ERR <<"Parser not initialized" << std::endl;
return -1;
}
@@ -794,12 +794,12 @@
std::string filename = multiple_files ? files[0] : file;
if (!inifile.isDirty())
{
- LIMAL_SLOG_DEBUG (logger, "File " << filename << " did not change. Not saving." );
+ DBG << "File " << filename << " did not change. Not saving." << std::endl;
return 0;
}
if (read_only)
{
- LIMAL_SLOG_DEBUG (logger, "Attempt to write file " << filename << " that was mounted read-only. Not saving." );
+ DBG << "Attempt to write file " << filename << " that was mounted read-only. Not saving." << std::endl;
return 0;
}
UpdateIfModif ();
@@ -819,7 +819,7 @@
std::string filename = getFileName (s.getName (), wb);
if (!s.isDirty ()) {
- LIMAL_SLOG_DEBUG (logger, "Skipping file " << filename.c_str() << " that was not changed." );
+ DBG << "Skipping file " << filename.c_str() << " that was not changed." << std::endl;
continue;
}
s.initReadBy ();
@@ -829,7 +829,7 @@
if (!of.good())
{
bugs++;
- LIMAL_SLOG_ERROR (logger,"Can not open file " << filename.c_str() << " for write");
+ ERR <<"Can not open file " << filename.c_str() << " for write" << std::endl;
continue;
}
write_helper (s, of, 0);
@@ -838,7 +838,7 @@
}
else
{
- LIMAL_SLOG_ERROR (logger,"Value "<< ci->e ().getName () <<" encountered at multifile top level" );
+ ERR <<"Value "<< ci->e ().getName () <<" encountered at multifile top level" << std::endl;
}
}
}
@@ -849,7 +849,7 @@
ofstream of(file.c_str());
if (!of.good())
{
- LIMAL_SLOG_ERROR (logger,"Can not open file " << file.c_str() << " for write");
+ ERR <<"Can not open file " << file.c_str() << " for write" << std::endl;
return -1;
}
@@ -924,7 +924,7 @@
int max = rewrites[rb].out.length () + sec.length () + 1;
char*buf = new char[max + 1];
snprintf (buf, max, rewrites[rb].out.c_str (), sec.c_str());
- LIMAL_SLOG_DEBUG (logger, "Rewriting " << sec.c_str() << " to " << buf);
+ DBG << "Rewriting " << sec.c_str() << " to " << buf << std::endl;
file = buf;
delete [] buf;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.h
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.h?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.h (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.h Sat Jul 17 18:38:59 2010
@@ -256,7 +256,7 @@
int write_helper(IniSection&ini, std::ofstream&of,int depth);
// create Logger instance
- Logger logger;
+ //Logger logger;
IniParser(const IniParser &);
IniParser& operator=(const IniParser &);
@@ -273,7 +273,7 @@
linecomments (), comments (),
sections (), params (), rewrites (),
started (false), multiple_files (false),
- logger (INIPARSER),
+ //logger (INIPARSER),
// inifile ("toplevel")
inifile (this)
{}
Added: limal-branches/mc-devel/limal-ca-mgm/src/LogControl.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/LogControl.cpp?rev=2689&view=auto
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/LogControl.cpp (added)
+++ limal-branches/mc-devel/limal-ca-mgm/src/LogControl.cpp Sat Jul 17 18:38:59 2010
@@ -0,0 +1,439 @@
+/** \file LogControl.cc
+ *
+*/
+#include <iostream>
+#include <fstream>
+#include <string>
+
+#include
+#include
+//#include "zypp/base/ProfilingFormater.h"
+#include
+#include
+#include
+
+using std::endl;
+
+///////////////////////////////////////////////////////////////////
+namespace ca_mgm
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ namespace log
+ { /////////////////////////////////////////////////////////////////
+
+ StdoutLineWriter::StdoutLineWriter()
+ : StreamLineWriter( std::cout )
+ {}
+
+ StderrLineWriter::StderrLineWriter()
+ : StreamLineWriter( std::cerr )
+ {}
+
+ FileLineWriter::FileLineWriter( const path::PathName & file_r, mode_t mode_r )
+ {
+ if ( file_r == path::PathName("-") )
+ {
+ _str = &std::cerr;
+ }
+ else
+ {
+ // set unbuffered write
+ std::ofstream * fstr = 0;
+ _outs.reset( (fstr = new std::ofstream( file_r.toString().c_str(), std::ios_base::app )) );
+ fstr->rdbuf()->pubsetbuf(0,0);
+ _str = &(*fstr);
+ if ( mode_r )
+ {
+ // not filesystem::chmod, as filesystem:: functions log,
+ // and this FileWriter is not yet in place.
+ ::chmod( file_r.toString().c_str(), mode_r );
+ }
+ }
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace log
+ ///////////////////////////////////////////////////////////////////
+
+
+ ///////////////////////////////////////////////////////////////////
+ // LineFormater
+ ///////////////////////////////////////////////////////////////////
+ std::string LogControl::LineFormater::format( const std::string & group_r,
+ logger::LogLevel level_r,
+ const char * file_r,
+ const char * func_r,
+ int line_r,
+ const std::string & message_r )
+ {
+ static char hostname[1024];
+ static char nohostname[] = "unknown";
+ std::string now( Date::now().form( "%Y-%m-%d %H:%M:%S" ) );
+ return str::form( "%s <%d> %s(%d) [%s] %s(%s):%d %s",
+ now.c_str(), level_r,
+ ( gethostname( hostname, 1024 ) ? nohostname : hostname ),
+ getpid(),
+ group_r.c_str(),
+ file_r, func_r, line_r,
+ message_r.c_str() );
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ namespace logger
+ { /////////////////////////////////////////////////////////////////
+
+ inline void putStream( const std::string & group_r, LogLevel level_r,
+ const char * file_r, const char * func_r, int line_r,
+ const std::string & buffer_r );
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : Loglinebuf
+ //
+ class Loglinebuf : public std::streambuf {
+
+ public:
+ /** */
+ Loglinebuf( const std::string & group_r, LogLevel level_r )
+ : _group( group_r )
+ , _level( level_r )
+ , _file( "" )
+ , _func( "" )
+ , _line( -1 )
+ {}
+ /** */
+ ~Loglinebuf()
+ {
+ if ( !_buffer.empty() )
+ writeout( "\n", 1 );
+ }
+
+ /** */
+ void tagSet( const char * fil_r, const char * fnc_r, int lne_r )
+ {
+ _file = fil_r;
+ _func = fnc_r;
+ _line = lne_r;
+ }
+
+ private:
+ /** */
+ virtual std::streamsize xsputn( const char * s, std::streamsize n )
+ { return writeout( s, n ); }
+ /** */
+ virtual int overflow( int ch = EOF )
+ {
+ if ( ch != EOF )
+ {
+ char tmp = ch;
+ writeout( &tmp, 1 );
+ }
+ return 0;
+ }
+ /** */
+ virtual int writeout( const char* s, std::streamsize n )
+ {
+ if ( s && n )
+ {
+ const char * c = s;
+ for ( int i = 0; i < n; ++i, ++c )
+ {
+ if ( *c == '\n' ) {
+ _buffer += std::string( s, c-s );
+ logger::putStream( _group, _level, _file, _func, _line, _buffer );
+ _buffer = std::string();
+ s = c+1;
+ }
+ }
+ if ( s < c )
+ {
+ _buffer += std::string( s, c-s );
+ }
+ }
+ return n;
+ }
+
+ private:
+ std::string _group;
+ LogLevel _level;
+ const char * _file;
+ const char * _func;
+ int _line;
+ std::string _buffer;
+ };
+
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : Loglinestream
+ //
+ class Loglinestream {
+
+ public:
+ /** */
+ Loglinestream( const std::string & group_r, LogLevel level_r )
+ : _mybuf( group_r, level_r )
+ , _mystream( &_mybuf )
+ {}
+ /** */
+ ~Loglinestream()
+ { _mystream.flush(); }
+
+ public:
+ /** */
+ std::ostream & getStream( const char * fil_r, const char * fnc_r, int lne_r )
+ {
+ _mybuf.tagSet( fil_r, fnc_r, lne_r );
+ return _mystream;
+ }
+
+ private:
+ Loglinebuf _mybuf;
+ std::ostream _mystream;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : LogControlImpl
+ //
+ /** LogControl implementation (Singleton).
+ *
+ * \note There is a slight difference in using the _lineFormater and _lineWriter!
+ * \li \c _lineFormater must not be NULL (create default LogControl::LineFormater)
+ * \li \c _lineWriter is NULL if no logging is performed, this way we can pass
+ * _no_stream as logstream to the application, and avoid unnecessary formating
+ * of logliles, which would then be discarded when passed to some dummy
+ * LineWriter.
+ */
+ struct LogControlImpl
+ {
+ public:
+ bool isEnabledFor( LogLevel level_r )
+ { return (level_r <= _level); }
+
+ void setLogLevel( LogLevel level_r )
+ { _level = level_r; }
+
+ /** NULL _lineWriter indicates no loggin. */
+ void setLineWriter( const shared_ptrLogControl::LineWriter & writer_r )
+ { _lineWriter = writer_r; }
+
+ shared_ptrLogControl::LineWriter getLineWriter() const
+ { return _lineWriter; }
+
+ /** Assert \a _lineFormater is not NULL. */
+ void setLineFormater( const shared_ptrLogControl::LineFormater & format_r )
+ {
+ if ( format_r )
+ _lineFormater = format_r;
+ else
+ _lineFormater.reset( new LogControl::LineFormater );
+ }
+
+ void logfile( const path::PathName & logfile_r, mode_t mode_r = 0640 )
+ {
+ if ( logfile_r.empty() )
+ setLineWriter( shared_ptrLogControl::LineWriter() );
+ else if ( logfile_r == path::PathName( "-" ) )
+ setLineWriter( shared_ptrLogControl::LineWriter(new log::StderrLineWriter) );
+ else
+ setLineWriter( shared_ptrLogControl::LineWriter(new log::FileLineWriter(logfile_r, mode_r)) );
+ }
+
+ private:
+ std::ostream _no_stream;
+ int _level;
+
+ shared_ptrLogControl::LineFormater _lineFormater;
+ shared_ptrLogControl::LineWriter _lineWriter;
+
+ public:
+ /** Provide the log stream to write (logger interface) */
+ std::ostream & getStream( const std::string & group_r,
+ LogLevel level_r,
+ const char * file_r,
+ const char * func_r,
+ const int line_r )
+ {
+ if ( ! _lineWriter )
+ return _no_stream;
+ if ( level_r > _level )
+ return _no_stream;
+
+ if ( !_streamtable[group_r][level_r] )
+ {
+ _streamtable[group_r][level_r].reset( new Loglinestream( group_r, level_r ) );
+ }
+ return _streamtable[group_r][level_r]->getStream( file_r, func_r, line_r );
+ }
+
+ /** Format and write out a logline from Loglinebuf. */
+ void putStream( const std::string & group_r,
+ LogLevel level_r,
+ const char * file_r,
+ const char * func_r,
+ int line_r,
+ const std::string & message_r )
+ {
+ if ( _lineWriter )
+ _lineWriter->writeOut( _lineFormater->format( group_r, level_r,
+ file_r, func_r, line_r,
+ message_r ) );
+ }
+
+ private:
+ typedef shared_ptr<Loglinestream> StreamPtr;
+ typedef std::map StreamSet;
+ typedef std::mapstd::string,StreamSet StreamTable;
+ /** one streambuffer per group and level */
+ StreamTable _streamtable;
+
+ private:
+ /** Singleton ctor.
+ * No logging per default, unless enabled via $ZYPP_LOGFILE.
+ */
+ LogControlImpl()
+ : _no_stream( NULL )
+ , _level( E_INFO )
+ , _lineFormater( new LogControl::LineFormater )
+ {
+ if ( getenv("ZYPP_LOGFILE") )
+ logfile( getenv("ZYPP_LOGFILE") );
+ }
+
+ public:
+ /** The LogControlImpl singleton
+ * \note As most dtors log, it is inportant that the
+ * LogControlImpl instance is the last static variable
+ * destructed. At least destucted after all statics
+ * which log from their dtor.
+ */
+ static LogControlImpl instance;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ // 'THE' LogControlImpl singleton
+ LogControlImpl LogControlImpl::instance;
+
+ ///////////////////////////////////////////////////////////////////
+
+ /** \relates LogControlImpl Stream output */
+ inline std::ostream & operator<<( std::ostream & str, const LogControlImpl & obj )
+ {
+ return str << "LogControlImpl";
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // Access from logger::
+ //
+ ///////////////////////////////////////////////////////////////////
+
+ std::ostream & getStream( const char * group_r,
+ LogLevel level_r,
+ const char * file_r,
+ const char * func_r,
+ const int line_r )
+ {
+ return LogControlImpl::instance.getStream( group_r,
+ level_r,
+ file_r,
+ func_r,
+ line_r );
+ }
+
+ /** That's what Loglinebuf calls. */
+ inline void putStream( const std::string & group_r, LogLevel level_r,
+ const char * file_r, const char * func_r, int line_r,
+ const std::string & buffer_r )
+ {
+ LogControlImpl::instance.putStream( group_r, level_r,
+ file_r, func_r, line_r,
+ buffer_r );
+ }
+
+ bool isEnabledFor( logger::LogLevel level_r )
+ { return LogControlImpl::instance.isEnabledFor( level_r ); }
+
+ void setLogLevel( logger::LogLevel level_r )
+ { LogControlImpl::instance.setLogLevel( level_r); }
+
+ std::string logLevelToString( LogLevel level_r )
+ {
+ switch (level_r)
+ {
+ case E_FATAL:
+ return "FATAL";
+ break;
+ case E_ERROR:
+ return "ERROR";
+ break;
+ case E_WARN:
+ return "WARN";
+ break;
+ case E_INFO:
+ return "INFO";
+ break;
+ case E_DEBUG:
+ return "DEBUG";
+ break;
+ }
+ return "UNKNOWN";
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace logger
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : LogControl
+ // Forward to LogControlImpl singleton.
+ //
+ ///////////////////////////////////////////////////////////////////
+
+ using logger::LogControlImpl;
+
+ void LogControl::logfile( const path::PathName & logfile_r )
+ { LogControlImpl::instance.logfile( logfile_r ); }
+
+ void LogControl::logfile( const path::PathName & logfile_r, mode_t mode_r )
+ { LogControlImpl::instance.logfile( logfile_r, mode_r ); }
+
+ shared_ptrLogControl::LineWriter LogControl::getLineWriter() const
+ { return LogControlImpl::instance.getLineWriter(); }
+
+ void LogControl::setLineWriter( const shared_ptr<LineWriter> & writer_r )
+ { LogControlImpl::instance.setLineWriter( writer_r ); }
+
+ void LogControl::setLineFormater( const shared_ptr<LineFormater> & formater_r )
+ { LogControlImpl::instance.setLineFormater( formater_r ); }
+
+ void LogControl::logNothing()
+ { LogControlImpl::instance.setLineWriter( shared_ptr<LineWriter>() ); }
+
+ void LogControl::logToStdErr()
+ { LogControlImpl::instance.setLineWriter( shared_ptr<LineWriter>( new log::StderrLineWriter ) ); }
+
+ bool LogControl::isEnabledFor( logger::LogLevel level_r )
+ { return LogControlImpl::instance.isEnabledFor( level_r ); }
+
+ void LogControl::setLogLevel( logger::LogLevel level_r )
+ { LogControlImpl::instance.setLogLevel( level_r); }
+
+ /******************************************************************
+ **
+ ** FUNCTION NAME : operator<<
+ ** FUNCTION TYPE : std::ostream &
+ */
+ std::ostream & operator<<( std::ostream & str, const LogControl & obj )
+ {
+ return str << LogControlImpl::instance;
+ }
+
+ /////////////////////////////////////////////////////////////////
+} // namespace ca_mgm
+///////////////////////////////////////////////////////////////////
Modified: limal-branches/mc-devel/limal-ca-mgm/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/Makefile.am?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/Makefile.am (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/Makefile.am Sat Jul 17 18:38:59 2010
@@ -22,7 +22,7 @@
ValueIntCheck.cpp \
ValueCheck.cpp \
Exception.cpp \
- Logger.cpp \
+ LogControl.cpp \
PathName.cpp \
PathInfo.cpp \
PathUtils.cpp \
Modified: limal-branches/mc-devel/limal-ca-mgm/src/Utils.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/Utils.hpp?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/Utils.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/Utils.hpp Sat Jul 17 18:38:59 2010
@@ -46,18 +46,28 @@
// -------------------------------------------------------------------
#define LOGIT(level,message) \
-LIMAL_SLOG(Logger("ca-mgm"), level, message)
+LIMAL_LOGGER_LOG("ca-mgm", level) << message << std::endl
#define LOGIT_DEBUG(message) \
- LIMAL_SLOG(Logger("ca-mgm"), blocxx::E_DEBUG_LEVEL, message)
+ _DBG("ca-mgm") << message << std::endl
#define LOGIT_INFO(message) \
- LIMAL_SLOG(Logger("ca-mgm"), blocxx::E_INFO_LEVEL, message)
+ _INF("ca-mgm") << message << std::endl
#define LOGIT_ERROR(message) \
- LIMAL_SLOG(Logger("ca-mgm"), blocxx::E_ERROR_LEVEL, message)
+ _ERR("ca-mgm") << message << std::endl
#define LOGIT_DEBUG_STRINGARRAY(text, stringarray) \
+ if( ca_mgm::logger::isEnabledFor(ca_mgm::logger::E_DEBUG) ) { \
+ uint s = stringarray.size(); \
+ for(uint i = 0; i < s; i++) { \
+ _DBG("ca-mgm") << text << "(" << (i+1) << "/" << s << "):" \
+ << stringarray[i] << std::endl; \
+ } \
+ } \
+
+/*
+#define LOGIT_DEBUG_STRINGARRAY(text, stringarray) \
Logger d("ca-mgm"); \
if(d.isEnabledFor("DEBUG")) { \
uint s = stringarray.size(); \
@@ -68,6 +78,7 @@
<< stringarray[i]); \
} \
}
+*/
// -------------------------------------------------------------------
Added: limal-branches/mc-devel/limal-ca-mgm/src/limal/LogControl.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/LogControl.hpp?rev=2689&view=auto
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/LogControl.hpp (added)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/LogControl.hpp Sat Jul 17 18:38:59 2010
@@ -0,0 +1,166 @@
+/** \file limal/LogControl.h
+ *
+*/
+#ifndef LIMAL_LOGCONTROL_H
+#define LIMAL_LOGCONTROL_H
+
+#include <iosfwd>
+
+#include
+#include
+#include
+
+///////////////////////////////////////////////////////////////////
+namespace ca_mgm
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ namespace log
+ { /////////////////////////////////////////////////////////////////
+
+ /** If you want to log the (formated) loglines by yourself,
+ * derive from this, and overload \c writeOut.
+ * Expect \a formated_r to be a formated log line without trailing \c NL.
+ * Ready to be written to the log.
+ */
+ struct LineWriter
+ {
+ virtual void writeOut( const std::string & /*formated_r*/ )
+ {}
+ virtual ~LineWriter()
+ {}
+ };
+
+ /** Base class for ostream based \ref LineWriter */
+ struct StreamLineWriter : public LineWriter
+ {
+ StreamLineWriter( std::ostream & str_r ) : _str( &str_r ) {}
+
+ virtual void writeOut( const std::string & formated_r )
+ { (*_str) << formated_r << std::endl; }
+
+ protected:
+ StreamLineWriter() : _str( 0 ) {}
+ std::ostream *_str;
+ };
+
+ /** \ref LineWriter to stdout. */
+ struct StdoutLineWriter : public StreamLineWriter
+ {
+ StdoutLineWriter();
+ };
+
+ /** \ref LineWriter to stderr. */
+ struct StderrLineWriter : public StreamLineWriter
+ {
+ StderrLineWriter();
+ };
+
+ /** \ref LineWriter to file.
+ * If \c mode_r is not \c 0, \c file_r persissions are changed
+ * accordingly. \c "-" logs to \c cerr.
+ */
+ struct FileLineWriter : public StreamLineWriter
+ {
+ FileLineWriter( const path::PathName & file_r, mode_t mode_r = 0 );
+ protected:
+ shared_ptr<void> _outs;
+ };
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace log
+ ///////////////////////////////////////////////////////////////////
+
+
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : LogControl
+ //
+ /** Maintain logfile related options.
+ * \note A Singleton using a Singleton implementation class,
+ * that's why there is no _pimpl like in other classes.
+ */
+ class LogControl
+ {
+ friend std::ostream & operator<<( std::ostream & str, const LogControl & obj );
+
+ public:
+ /** Singleton access. */
+ static LogControl instance()
+ { return LogControl(); }
+
+
+ /** \see \ref log::LineWriter */
+ typedef log::LineWriter LineWriter;
+
+ /** If you want to format loglines by yourself,
+ * derive from this, and overload \c format.
+ * Return a formated logline without trailing \c NL.
+ * Ready to be written to the log.
+ */
+ struct LineFormater
+ {
+ virtual std::string format( const std::string & /*group_r*/,
+ logger::LogLevel /*level_r*/,
+ const char * /*file_r*/,
+ const char * /*func_r*/,
+ int /*line_r*/,
+ const std::string & /*message_r*/ );
+ virtual ~LineFormater() {}
+ };
+
+ public:
+ /** Assign a LineFormater.
+ * If you want to format loglines by yourself. NULL installs the
+ * default formater.
+ */
+ void setLineFormater( const shared_ptr<LineFormater> & formater_r );
+
+ public:
+ /** Set path for the logfile.
+ * Permission for logfiles is set to 0640 unless an explicit mode_t
+ * value is given. An empty pathname turns off logging. <tt>"-"</tt>
+ * logs to std::err.
+ * \throw if \a logfile_r is not usable.
+ */
+ void logfile( const path::PathName & logfile_r );
+ void logfile( const path::PathName & logfile_r, mode_t mode_r );
+
+ /** Turn off logging. */
+ void logNothing();
+
+ /** Log to std::err. */
+ void logToStdErr();
+
+ /** return true is the level_r would be logged */
+ bool isEnabledFor( logger::LogLevel level_r );
+
+ /** set the new maximal log level */
+ void setLogLevel( logger::LogLevel level_r );
+
+ public:
+ /** Get the current LineWriter */
+ shared_ptr<LineWriter> getLineWriter() const;
+
+ /** Assign a LineWriter.
+ * If you want to log the (formated) loglines by yourself.
+ * NULL turns off logging (same as logNothing)
+ * \see \ref log::LineWriter
+ */
+ void setLineWriter( const shared_ptr<LineWriter> & writer_r );
+
+ private:
+ /** Default ctor: Singleton */
+ LogControl()
+ {}
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /** \relates LogControl Stream output */
+ std::ostream & operator<<( std::ostream & str, const LogControl & obj );
+
+ /////////////////////////////////////////////////////////////////
+} // namespace ca_mgm
+///////////////////////////////////////////////////////////////////
+#endif // LIMAL_LOGCONTROL_H
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/Logger.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/Logger.hpp?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/Logger.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/Logger.hpp Sat Jul 17 18:38:59 2010
@@ -1,591 +1,113 @@
/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
| |
-| _ _ _ _ __ _ |
-| | | | | | \_/ | / \ | | |
-| | | | | | |_| | / /\ \ | | |
-| | |__ | | | | | | / ____ \ | |__ |
-| |____||_| |_| |_|/ / \ \|____| |
-| |
-| core library |
-| |
-| (C) SUSE Linux Products GmbH |
-\----------------------------------------------------------------------/
-
- File: Logger.hpp
-
- Author: Marius Tomaschewski
- Maintainer: Marius Tomaschewski
-
-/-*/
-/**
- * @file Logger.hpp
- * @brief LiMaL logging utilities.
- *
- * The LiMaL extensions to the BloCxx logging framework.
- */
-#ifndef LIMAL_LOGGER_HPP
-#define LIMAL_LOGGER_HPP
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-/**
- * @brief Generic logging macro LIMAL_LOG
- *
- * This macro write a log message with the given level.
+\---------------------------------------------------------------------*/
+/** \file zypp/base/Logger.h
*
- * @param logger a Logger object
- * @param level a log level
- * @param message a log message
- *
- * @code
- * ca_mgm::Logger lg("MyComponentName");
- * LIMAL_LOG(lg, DEBUG, "the log message");
- * LIMAL_LOG(lg, DEBUG, blocxx::Format("log message nr %1", 2));
- * @endcode
- */
-#define LIMAL_LOG(logger, level, message) \
-do \
-{ \
- int err = errno; \
- if( (logger).isEnabledFor(level)) \
- { \
- (logger).logMessage((level), (message), \
- __FILE__, __LINE__, \
- BLOCXX_LOGGER_PRETTY_FUNCTION); \
- } \
- errno = err; \
-} while(0) // note the missing semicolon
-
-
-/**
- * @brief Generic logging macro LIMAL_SLOG allowing
- * formating using a stream output operator <<.
- *
- * This macro write a log message with the given level.
- *
- * @param logger a Logger object
- * @param level a log level
- * @param message a log message
- *
- * @code
- * ca_mgm::Logger lg("MyComponentName");
- * LIMAL_SLOG(lg, DEBUG, "log message nr " << 3);
- * @endcode
- */
-#define LIMAL_SLOG(logger, level, message) \
-do \
-{ \
- int err = errno; \
- if( (logger).isEnabledFor(level)) \
- { \
- blocxx::OStringStream _buf; \
- _buf << message; \
- (logger).logMessage((level), _buf.toString(), \
- __FILE__, __LINE__, \
- BLOCXX_LOGGER_PRETTY_FUNCTION); \
- } \
- errno = err; \
-} while(0) // note the missing semicolon
-
-
-/**
- * @brief Logging macro LIMAL_LOG_FATAL.
- *
- * This macro write a log message with the log level FATAL.
- *
- * @param logger a Logger object
- * @param logMessage the log message
- *
- * @code
- * ca_mgm::Logger lg("MyComponentName");
- * LIMAL_LOG_FATAL(lg, "the log message");
- * LIMAL_SLOG_FATAL(lg, "log message " << 42);
- * @endcode
- */
-#define LIMAL_LOG_FATAL(logger, logMessage) \
- LIMAL_LOG(logger, blocxx::E_FATAL_ERROR_LEVEL, logMessage)
-
-#define LIMAL_SLOG_FATAL(logger, logMessage) \
- LIMAL_SLOG(logger, blocxx::E_FATAL_ERROR_LEVEL, logMessage)
-
-
-/**
- * @brief Logging macro LIMAL_LOG_ERROR
- *
- * This macro write a log message with the log level ERROR
- *
- * @param logger a Logger object
- * @param logMessage the log message
- *
- * @code
- * ca_mgm::Logger lg("MyComponentName");
- * LIMAL_LOG_ERROR(lg, "the log message");
- * LIMAL_SLOG_ERROR(lg, "log message " << 42);
- * @endcode
- */
-#define LIMAL_LOG_ERROR(logger, logMessage) \
- LIMAL_LOG(logger, blocxx::E_ERROR_LEVEL, logMessage)
-
-#define LIMAL_SLOG_ERROR(logger, logMessage) \
- LIMAL_SLOG(logger, blocxx::E_ERROR_LEVEL, logMessage)
-
-
-/**
- * @brief Logging macro LIMAL_LOG_INFO
- *
- * This macro write a log message with the log level INFO
- *
- * @param logger a Logger object
- * @param logMessage the log message
- *
- * @code
- * ca_mgm::Logger lg("MyComponentName");
- * LIMAL_LOG_INFO(lg, "the log message");
- * LIMAL_SLOG_INFO(lg, "log message " << 42);
- * @endcode
- */
-#define LIMAL_LOG_INFO(logger, logMessage) \
- LIMAL_LOG(logger, blocxx::E_INFO_LEVEL, logMessage)
-
-#define LIMAL_SLOG_INFO(logger, logMessage) \
- LIMAL_SLOG(logger, blocxx::E_INFO_LEVEL, logMessage)
-
-
-/**
- * @brief Logging macro LIMAL_LOG_DEBUG
- *
- * This macro write a log message with the log level DEBUG
- *
- * @param logger a Logger object
- * @param logMessage the log message
- *
- * @code
- * ca_mgm::Logger lg("MyComponentName");
- * LIMAL_LOG_DEBUG(lg, "the log message");
- * LIMAL_SLOG_DEBUG(lg, "log message " << 42);
- * @endcode
- */
-#define LIMAL_LOG_DEBUG(logger, logMessage) \
- LIMAL_LOG(logger, blocxx::E_DEBUG_LEVEL, logMessage)
-
-#define LIMAL_SLOG_DEBUG(logger, logMessage) \
- LIMAL_SLOG(logger, blocxx::E_DEBUG_LEVEL, logMessage)
-
-
-namespace LIMAL_NAMESPACE
-{
-
-/**
- * @brief LiMaL library logger class.
- *
- * The LiMaL logger class provides several static functions allowing to
- * create standard logger types (file, cerr, syslog), to set them as the
- * global/default or per thread logger in the blocxx library as well as
- * to retrieve them.
- *
- * Each instance of the LiMaL logger contains a optional local component
- * name, that is passed with every log message to the current logger and
- * used instead of the default component name, that is set in the logger.
- *
- * This allows to use different component names at different places of
- * the application and/or library, e.g. each plugin logs messages using
- * own component name.
- *
- * The LiMaL logger instance can be used directly or with the LIMAL_LOG(),
- * LIMAL_SLOG() and derived macros.
- *
- * @par BloCxx Log Message Format
- *
- * BloCxx supports configuration of the log message format using printf()
- * style conversion specifiers.
- *
- * Available conversion specifiers:
- * @li @c %%c The component (e.g. myapp)
- * @li @c %%d The date. May be followed by a date format specifier enclosed
- * between braces. Examples:
- * @code
- * "%d{%H:%M:%S}"
- * "%d{%d %b %Y %H:%M:%S}"
- * @endcode
- * If no date format specifier is given then ISO8601 format is
- * assumed. For more information of the date format specifiers,
- * lookup the documentation for the strftime() function found
- * in the \ header.
- * The only addition is %%Q, which is the number of milliseconds.
- * @li @c %%F The file name
- * @li @c %%l The filename and line number. e.g. file.cpp(100)
- * @li @c %%L The line number
- * @li @c %%M The method name where the logging request was issued
- * (only works on C++ compilers which support
- * @c __PRETTY_FUNCTION__ or C99's @c __func__)
- * @li @c %%m The message
- * @li @c %%e The message as XML CDATA. This includes the @c "<![CDATA["
- * and ending @c "]]>"
- * @li @c %%n The platform dependent line separator character (\\n) or
- * characters (\\r\\n)
- * @li @c %%P The process id
- * @li @c %%p Category, aka level, aka priority
- * @li @c %%r The number of milliseconds elapsed since the start of the
- * application until the creation of the logging event
- * @li @c %%t The thread id
- * @li @c %%%% The \% character.
- * @li @c \\n The newline character
- * @li @c \\t The tab character
- * @li @c \\r The linefeed character
- * @li @c \\\\ The \\ character
- * @li @c \\x<hexDigits> The character represented in hexadecimal.
- *
- * It is possible to change the minimum field width, the maximum field width
- * and justification. The optional format modifier is placed between the
- * percent sign and the conversion character.
- *
- * The first optional format modifier is the left justification flag which is
- * the minus (-) character. The optional minimum field width modifier follows.
- * It is an integer that represents the minimum number of characters to output.
- * If the data item requires fewer characters, it is padded with spaces on
- * either the left or the right, according to the justification flag. If the
- * data item is larger than the minimum field width, the field is expanded to
- * accommodate the data.
- *
- * The maximum field width modifier is designated by a period followed by a
- * decimal constant. If the data item is longer than the maximum field, then
- * the extra characters are removed from the beginning of the data item (by
- * default), or from the end if the left justification flag was specified.
- *
- * Examples:
- *
- * Log4j TTCC layout:
- * @code "%r [%t] %-5p %c - %m" @endcode
- *
- * Similar to TTCC, but with some fixed size fields:
- * @code "%-6r [%15.15t] %-5p %30.30c - %m" @endcode
- *
- * The TTCC message format is defined in the
- * @c blocxx::LogAppender::STR_TTCC_MESSAGE_FORMAT constant.
- */
-class Logger
-{
-public:
- /**
- * @brief Log level constants.
- *
- * Possible category names and their corresponding log levels are:
- *
- * @li @code "FATAL" blocxx::E_FATAL_ERROR_LEVEL @endcode
- * @li @code "ERROR" blocxx::E_ERROR_LEVEL @endcode
- * @li @code "INFO" blocxx::E_INFO_LEVEL @endcode
- * @li @code "DEBUG" blocxx::E_DEBUG_LEVEL @endcode
- */
- typedef blocxx::ELogLevel ELogLevel;
-
- /**
- * @brief Create a new logger reference to a CerrLogger object.
- *
- * A application can use this function to create a logger reference
- * pointing to a CerrLogger. The resulting reference object can be
- * passed to the setDefaultLogger() or setThreadLogger() methods.
- *
- * @code
- * std::vectorblocxx::String components;
- * components.push_back("*");
- *
- * std::vectorblocxx::String categories;
- * categories.push_back("*");
- *
- * blocxx::LoggerRef l = ca_mgm::Logger::createCerrLogger(
- * "main", components, categories,
- * "%r [%d] %p %c - %m"
- * );
- *
- * ca_mgm::Logger::setDefaultLogger(l);
- * @endcode
- *
- * @param component The default component name (application name).
- * @param components A filter list with component names that should
- * be logged or "*" to log all components.
- * @param categories A filter list with category names that should
- * be logged or "*" for all categories. Category
- * names are "FATAL", "ERROR", "INFO", "DEBUG".
- * @param messageFormat A log message format string or empty string
- * for default format defined by the logger.
- * @return return A logger reference pointing to the CerrLogger.
- */
- static blocxx::LoggerRef createCerrLogger(
- const blocxx::String &component,
- const blocxx::StringArray &components,
- const blocxx::StringArray &categories,
- const blocxx::String &messageFormat
- );
-
- /**
- * @brief Create a new logger reference to a SyslogLogger object.
- *
- * A application can use this function to create a logger reference
- * pointing to a SyslogLogger. The resulting reference object can be
- * passed to the setDefaultLogger() or setThreadLogger() methods.
- *
- * @code
- * std::vectorblocxx::String components(1, "*");
- * std::vectorblocxx::String categories(1, "*");
- *
- * blocxx::LoggerRef l = ca_mgm::Logger::createSyslogLogger(
- * "main", components, categories,
- * "%r [%d] %p %c - %m", "myApp", "user"
- * );
- *
- * ca_mgm::Logger::setDefaultLogger(l);
- * @endcode
- *
- * @param component The default component name (application name).
- * @param components A filter list with component names that should
- * be logged or "*" to log all components.
- * @param categories A filter list with category names that should
- * be logged or "*" for all categories. Category
- * names are "FATAL", "ERROR", "INFO", "DEBUG".
- * @param messageFormat A log message format string or empty string
- * for default format defined by the logger.
- * @param identity The syslog identity string.
- * @param facility The syslog facility to use ("user", "daemon", ...)
- * @return return A logger reference pointing to the SyslogLogger.
- */
- static blocxx::LoggerRef createSyslogLogger(
- const blocxx::String &component,
- const blocxx::StringArray &components,
- const blocxx::StringArray &categories,
- const blocxx::String &messageFormat,
- const blocxx::String &identity,
- const blocxx::String &facility
- );
-
-
- /**
- * @brief Create a new logger reference to a FileLogger object.
- *
- * A application can use this function to create a logger reference
- * pointing to a FileLogger. The resulting reference object can be
- * passed to the setDefaultLogger() or setThreadLogger() methods.
- *
- * @code
- * std::vectorblocxx::String components(1, "*");
- * std::vectorblocxx::String categories(1, "*");
- *
- * blocxx::LoggerRef l = ca_mgm::Logger::createFileLogger(
- * "main", components, categories,
- * "%r [%d] %p %c - %m",
- * "/var/log/limal.log", 1024, 2
- * );
- *
- * ca_mgm::Logger::setDefaultLogger(l);
- * @endcode
- *
- * @param component The default component name (application name).
- * @param components A filter list with component names that should
- * be logged or "*" to log all components.
- * @param categories A filter list with category names that should
- * be logged or "*" for all categories. Category
- * names are "FATAL", "ERROR", "INFO", "DEBUG".
- * @param messageFormat A log message format string or empty string
- * for default format defined by the logger.
- * @param filename The name of the log file.
- * @param maxLogFileSize The maximal file size in kb. 0 disables
- * automatic log file rotation.
- * @param maxBackupIndex Maximal count of backup log files.
- * @return return A logger reference pointing to the FileLogger.
- */
- static blocxx::LoggerRef createFileLogger(
- const blocxx::String &component,
- const blocxx::StringArray &components,
- const blocxx::StringArray &categories,
- const blocxx::String &messageFormat,
- const blocxx::String &filename,
- uint64_t maxLogFileSize = 0,
- uint32_t maxBackupIndex = 0
- );
-
- /**
- * @brief Create a new logger reference to a NullLogger object.
- *
- * A application can use this function to create a logger reference
- * pointing to a NullLogger. The resulting reference object can be
- * passed to the setDefaultLogger() or setThreadLogger() methods.
- *
- * @code
- * std::vectorblocxx::String components(1, "*");
- * std::vectorblocxx::String categories(1, "*");
- *
- * blocxx::LoggerRef l = ca_mgm::Logger::createNullLogger(
- * "main", components, categories,
- * "%r [%d] %p %c - %m"
- * );
- *
- * ca_mgm::Logger::setDefaultLogger(l);
- * @endcode
- *
- * @param component The default component name (application name).
- * @param components A filter list with component names that should
- * be logged or "*" to log all components.
- * @param categories A filter list with category names that should
- * be logged or "*" for all categories. Category
- * names are "FATAL", "ERROR", "INFO", "DEBUG".
- * @param messageFormat A log message format string or empty string
- * for default format defined by the logger.
- * @return return A logger reference pointing to the NullLogger.
- */
- static blocxx::LoggerRef createNullLogger(
- const blocxx::String &component,
- const blocxx::StringArray &components,
- const blocxx::StringArray &categories,
- const blocxx::String &messageFormat
- );
-
- /**
- * Create a new Logger instance.
- *
- * If no instance component is specified, then the default
- * component of the registered logger is used instead.
- *
- * @param component instance local component name
- */
- Logger(const blocxx::String &component = "");
-
-
- /**
- * Destroy a Logger instance
- */
- ~Logger();
-
-
- /**
- * Set the default logger.
- *
- * @param ref Reference to the new logger
- * @returns true if the logger was successfully set,
- * false if ref doesn't contain any logger.
- */
- inline static bool
- setDefaultLogger(const blocxx::LoggerRef &ref)
- {
- return Logger::setDefaultFromLoggerRef(ref);
- }
-
- /**
- * Set a per thread logger that overrides the default one.
- *
- * @param ref Reference to the new logger
- * @returns true if the logger was successfully set,
- * false if ref doesn't contain any logger.
- * @throws AssertException if try to put the logger
- * into a thread local storage area failed.
- */
- inline static bool
- setThreadLogger(const blocxx::LoggerRef &ref)
- {
- return Logger::setThreadFromLoggerRef(ref);
- }
-
- /**
- * Returns a copy of default logger (LoggerRef).
- * @returns a LoggerRef to the default logger
- */
- inline static blocxx::LoggerRef getDefaultLogger()
- {
- return Logger::getDefaultAsLoggerRef();
- }
-
- /**
- * Get a copy of the per thread logger (LoggerRef)
- * or if not set, the default one.
- *
- * @returns a LoggerRef to the current logger
- */
- inline static blocxx::LoggerRef getCurrentLogger()
- {
- return Logger::getCurrentAsLoggerRef();
- }
-
- /**
- * log a message with the specified level inclusive
- * the component name associated with the instance
- * if not empty.
- *
- * @param level a log level
- * @param message a log message
- * @param filename a file name (__FILE__)
- * @param fileline a line number (__LINE__)
- * @param methodname method name (__func__)
- */
- void
- logMessage(ELogLevel level,
- const blocxx::String &message,
- const char *filename = 0,
- int fileline = -1,
- const char *methodname = 0) const;
-
-
- /**
- * log a message using the specified category (a log
- * level name) inclusive component name associated
- * with the instance if not empty.
- *
- * @param category a log category
- * @param message a log message
- * @param filename a file name (__FILE__)
- * @param fileline a line number (__LINE__)
- * @param methodname method name (__func__)
- */
- void
- logMessage(const blocxx::String &category,
- const blocxx::String &message,
- const char *filename = 0,
- int fileline = -1,
- const char *methodname = 0) const;
-
-
- /**
- * Check if the logger is enabled for given level.
- *
- * @param level a log level
- * @return true if enabled or false
- */
- bool
- isEnabledFor(const ELogLevel level) const;
-
-
- /**
- * Check if the logger is enabled for given category
- * (named LogLevel, but not limited to).
- *
- * @param category a log category
- * @return true if enabled or false
- */
- bool
- isEnabledFor(const blocxx::String &category) const;
-
-
-private:
- static bool setDefaultFromLoggerRef(const blocxx::LoggerRef &ref);
- static bool setThreadFromLoggerRef(const blocxx::LoggerRef &ref);
- static blocxx::LoggerRef getDefaultAsLoggerRef();
- static blocxx::LoggerRef getCurrentAsLoggerRef();
-
- blocxx::String m_component;
-
-};
-
-
-} // LIMAL_NAMESPACE
-
-
-#endif // LIMAL_LOGGER_HPP
-/* vim: set ts=8 sts=8 sw=8 ai noet: */
-
+*/
+#ifndef LIMAL_LOGGER_H
+#define LIMAL_LOGGER_H
+
+#include <iosfwd>
+#include <cstring>
+#include
+
+/** \defgroup LIMAL_LOGGER_MACROS LIMAL_LOGGER_MACROS
+ * Convenience macros for logging.
+ *
+ * The macros finaly call @ref getStream, providing appropriate arguments,
+ * to return the log stream.
+ *
+ * @code
+ * _DBG("foo") << ....
+ * @endcode
+ * Logs a debug message for group @a "foo".
+ *
+ * @code
+ * #undef LIMAL_LOGGER_LOGGROUP
+ * #define LIMAL_LOGGER_LOGGROUP "foo"
+ *
+ * DBG << ....
+ * @endcode
+ * Defines group @a "foo" as default for log messages and logs a
+ * debug message.
+ */
+/*@{*/
+
+#ifndef LIMAL_LOGGER_LOGGROUP
+/** Default log group is ca_mgm. */
+#define LIMAL_LOGGER_LOGGROUP "ca_mgm"
+#endif
+
+#define DBG _DBG( LIMAL_LOGGER_LOGGROUP )
+#define INF _INF( LIMAL_LOGGER_LOGGROUP )
+#define WAR _WAR( LIMAL_LOGGER_LOGGROUP )
+#define ERR _ERR( LIMAL_LOGGER_LOGGROUP )
+#define FAT _FAT( LIMAL_LOGGER_LOGGROUP )
+
+#define _DBG(GROUP) LIMAL_LOGGER_LOG( GROUP, ca_mgm::logger::E_DEBUG )
+#define _INF(GROUP) LIMAL_LOGGER_LOG( GROUP, ca_mgm::logger::E_INFO )
+#define _WAR(GROUP) LIMAL_LOGGER_LOG( GROUP, ca_mgm::logger::E_WARN )
+#define _ERR(GROUP) LIMAL_LOGGER_LOG( GROUP, ca_mgm::logger::E_ERROR )
+#define _FAT(GROUP) LIMAL_LOGGER_LOG( GROUP, ca_mgm::logger::E_FATAL )
+
+#define _BASEFILE ( *__FILE__ == '/' ? strrchr( __FILE__, '/' ) + 1 : __FILE__ )
+
+/** Actual call to @ref getStream. */
+#define LIMAL_LOGGER_LOG(GROUP,LEVEL) \
+ ca_mgm::logger::getStream( GROUP, LEVEL, _BASEFILE, __FUNCTION__, __LINE__ )
+
+/*@}*/
+
+///////////////////////////////////////////////////////////////////
+namespace ca_mgm
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ namespace logger
+ { /////////////////////////////////////////////////////////////////
+
+ /** Definition of log levels.
+ *
+ * @see getStream
+ */
+ enum LogLevel {
+ E_FATAL = 1,
+ E_ERROR = 2,
+ E_WARN = 3,
+ E_INFO = 4,
+ E_DEBUG = 5
+ };
+ extern std::string logLevelToString( LogLevel level_r );
+
+ /** Return a log stream to write on.
+ *
+ * The returned log stream is determined by @a group_r and
+ * @a level_r. The remaining arguments @a file_r, @a func_r
+ * and @a line_r are expected to denote the location in the
+ * source code that issued the message.
+ *
+ * @note You won't call @ref getStream directly, but use the
+ * @ref LIMAL_LOGGER_MACROS.
+ */
+ extern std::ostream & getStream( const char * group_r,
+ LogLevel level_r,
+ const char * file_r,
+ const char * func_r,
+ const int line_r );
+ extern bool isEnabledFor( LogLevel level_r );
+
+ extern void setLogLevel( LogLevel level_r );
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace logger
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+} // namespace ca_mgm
+///////////////////////////////////////////////////////////////////
+#endif // LIMAL_LOGGER_H
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/Makefile.am
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/Makefile.am?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/Makefile.am (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/Makefile.am Sat Jul 17 18:38:59 2010
@@ -14,6 +14,7 @@
CallbackBase.hpp \
Exception.hpp \
Logger.hpp \
+ LogControl.hpp \
PathName.hpp \
PathInfo.hpp \
PathUtils.hpp \
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA1.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA1.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA1.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA1.cc Sat Jul 17 18:38:59 2010
@@ -1,17 +1,15 @@
-#include
-#include
-#include
-#include
+#include
#include
#include
#include
#include
+#include
#include <iostream>
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -24,20 +22,13 @@
{
cout << "START" << endl;
- StringArray comp;
- comp.push_back("ca-mgm");
- comp.push_back("limal");
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CA1",
- comp,
- LogAppender::ALL_CATEGORIES,
- "%-5p %c - %m"
- );
-
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_DEBUG );
+ logger.logToStdErr();
CA ca("ca1_test", "system", "./TestRepos/");
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA2.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA2.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA2.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA2.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
+#include
#include
#include
-#include
#include
#include
@@ -14,8 +10,7 @@
// FIXME: need to be removed
#include
-
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -30,13 +25,11 @@
}
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CA2",
- LogAppender::ALL_COMPONENTS,
- LogAppender::ALL_CATEGORIES,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_DEBUG );
+ logger.logToStdErr();
std::string file = argv[ 1 ];
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA3.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA3.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA3.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA3.cc Sat Jul 17 18:38:59 2010
@@ -1,7 +1,4 @@
-#include
-#include
-#include
-#include
+#include
#include
#include
#include
@@ -13,8 +10,7 @@
// FIXME: need to be removed
#include
-
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -29,13 +25,11 @@
}
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CA3",
- LogAppender::ALL_COMPONENTS,
- LogAppender::ALL_CATEGORIES,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_DEBUG );
+ logger.logToStdErr();
std::string file = argv[ 1 ];
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA4.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA4.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA4.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA4.cc Sat Jul 17 18:38:59 2010
@@ -1,7 +1,4 @@
-#include
-#include
-#include
-#include
+#include
#include
#include
#include
@@ -12,7 +9,7 @@
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -26,13 +23,11 @@
}
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CA4",
- LogAppender::ALL_COMPONENTS,
- LogAppender::ALL_CATEGORIES,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_DEBUG );
+ logger.logToStdErr();
std::string file = argv[ 1 ];
cout << "START" << endl;
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
+#include
#include
#include
-#include
#include
#include <iostream>
@@ -14,7 +10,7 @@
// FIXME: need to be removed
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -28,18 +24,12 @@
exit( 1 );
}
- StringArray comp;
- comp.push_back("ca-mgm");
- comp.push_back("limal");
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CA5",
- comp,
- LogAppender::ALL_CATEGORIES,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_DEBUG );
+ logger.logToStdErr();
std::string file = argv[ 1 ];
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase1.err
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase1.err?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase1.err (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase1.err Sat Jul 17 18:38:59 2010
@@ -30,19 +30,31 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=2 result=req_ca
DEBUG ca-mgm - type2Section: type=2 result=req_ca
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=2 result=req_ca
DEBUG ca-mgm - type2Section: type=2 result=req_ca
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
+DEBUG IniParser - Can not delete nsSslServerName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
+DEBUG IniParser - Can not delete nsComment Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
+DEBUG IniParser - Can not delete extendedKeyUsage Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
+DEBUG IniParser - Can not delete subjectKeyIdentifier Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
+DEBUG IniParser - Can not delete subjectAltName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=2 result=req_ca
DEBUG ca-mgm - type2Section: type=2 result=req_ca
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
@@ -78,6 +90,8 @@
DEBUG ca-mgm - DNObject::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - RequestGenerationData::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - removeFile ./TestRepos/ca1_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf.tmpl did not change. Not saving.
DEBUG ca-mgm - Command: /usr/bin/openssl rsa -noout -in ./TestRepos//ca2_test/cacert.key -passin env:PASSWORD
DEBUG ca-mgm - type2Section: type=2 result=req_ca
DEBUG ca-mgm - type2Section: type=2 result=req_ca
@@ -112,19 +126,31 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=2 result=req_ca
DEBUG ca-mgm - type2Section: type=2 result=req_ca
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=2 result=req_ca
DEBUG ca-mgm - type2Section: type=2 result=req_ca
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
+DEBUG IniParser - Can not delete nsSslServerName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
+DEBUG IniParser - Can not delete nsComment Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
+DEBUG IniParser - Can not delete extendedKeyUsage Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
+DEBUG IniParser - Can not delete subjectKeyIdentifier Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
+DEBUG IniParser - Can not delete subjectAltName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=2 result=req_ca
DEBUG ca-mgm - type2Section: type=2 result=req_ca
DEBUG ca-mgm - type2Section: type=2 result=v3_req_ca
@@ -162,3 +188,5 @@
DEBUG ca-mgm - DNObject::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - RequestGenerationData::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - removeFile ./TestRepos/ca2_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf.tmpl did not change. Not saving.
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase2.err
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase2.err?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase2.err (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase2.err Sat Jul 17 18:38:59 2010
@@ -30,19 +30,31 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=0 result=req_client
DEBUG ca-mgm - type2Section: type=0 result=req_client
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=0 result=req_client
DEBUG ca-mgm - type2Section: type=0 result=req_client
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
+DEBUG IniParser - Can not delete nsSslServerName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
+DEBUG IniParser - Can not delete nsComment Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
+DEBUG IniParser - Can not delete extendedKeyUsage Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
+DEBUG IniParser - Can not delete subjectKeyIdentifier Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
+DEBUG IniParser - Can not delete subjectAltName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=0 result=req_client
DEBUG ca-mgm - type2Section: type=0 result=req_client
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
@@ -78,6 +90,8 @@
DEBUG ca-mgm - DNObject::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - RequestGenerationData::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - removeFile ./TestRepos/ca1_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf.tmpl did not change. Not saving.
DEBUG ca-mgm - Command: /usr/bin/openssl rsa -noout -in ./TestRepos//ca2_test/cacert.key -passin env:PASSWORD
DEBUG ca-mgm - type2Section: type=0 result=req_client
DEBUG ca-mgm - type2Section: type=0 result=req_client
@@ -108,19 +122,33 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=0 result=req_client
DEBUG ca-mgm - type2Section: type=0 result=req_client
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=0 result=req_client
DEBUG ca-mgm - type2Section: type=0 result=req_client
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
+DEBUG IniParser - Can not delete nsSslServerName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
+DEBUG IniParser - Can not delete nsComment Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
+DEBUG IniParser - Can not delete basicConstraints Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
+DEBUG IniParser - Can not delete extendedKeyUsage Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
+DEBUG IniParser - Can not delete subjectKeyIdentifier Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
+DEBUG IniParser - Can not delete subjectAltName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=0 result=req_client
DEBUG ca-mgm - type2Section: type=0 result=req_client
DEBUG ca-mgm - type2Section: type=0 result=v3_req_client
@@ -154,3 +182,5 @@
DEBUG ca-mgm - DNObject::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - RequestGenerationData::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - removeFile ./TestRepos/ca2_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf.tmpl did not change. Not saving.
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase3.err
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase3.err?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase3.err (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5/testcase3.err Sat Jul 17 18:38:59 2010
@@ -30,19 +30,31 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=1 result=req_server
DEBUG ca-mgm - type2Section: type=1 result=req_server
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=1 result=req_server
DEBUG ca-mgm - type2Section: type=1 result=req_server
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
+DEBUG IniParser - Can not delete nsSslServerName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
+DEBUG IniParser - Can not delete nsComment Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
+DEBUG IniParser - Can not delete extendedKeyUsage Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
+DEBUG IniParser - Can not delete subjectKeyIdentifier Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
+DEBUG IniParser - Can not delete subjectAltName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=1 result=req_server
DEBUG ca-mgm - type2Section: type=1 result=req_server
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
@@ -78,6 +90,8 @@
DEBUG ca-mgm - DNObject::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - RequestGenerationData::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - removeFile ./TestRepos/ca1_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf.tmpl did not change. Not saving.
DEBUG ca-mgm - Command: /usr/bin/openssl rsa -noout -in ./TestRepos//ca2_test/cacert.key -passin env:PASSWORD
DEBUG ca-mgm - type2Section: type=1 result=req_server
DEBUG ca-mgm - type2Section: type=1 result=req_server
@@ -112,19 +126,31 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=1 result=req_server
DEBUG ca-mgm - type2Section: type=1 result=req_server
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=1 result=req_server
DEBUG ca-mgm - type2Section: type=1 result=req_server
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
+DEBUG IniParser - Can not delete nsSslServerName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
+DEBUG IniParser - Can not delete nsComment Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
+DEBUG IniParser - Can not delete extendedKeyUsage Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
+DEBUG IniParser - Can not delete subjectKeyIdentifier Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
+DEBUG IniParser - Can not delete subjectAltName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=1 result=req_server
DEBUG ca-mgm - type2Section: type=1 result=req_server
DEBUG ca-mgm - type2Section: type=1 result=v3_req_server
@@ -162,3 +188,5 @@
DEBUG ca-mgm - DNObject::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - RequestGenerationData::verify()(1/1):Value() is too small. Value has to be a minimal length of 2
DEBUG ca-mgm - removeFile ./TestRepos/ca2_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf.tmpl did not change. Not saving.
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
+#include
#include
#include
-#include
#include
#include <iostream>
@@ -14,7 +10,7 @@
// FIXME: need to be removed
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -27,18 +23,12 @@
exit( 1 );
}
- StringArray comp;
- comp.push_back("ca-mgm");
- comp.push_back("limal");
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CA6",
- comp,
- LogAppender::ALL_CATEGORIES,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_DEBUG );
+ logger.logToStdErr();
std::string file = argv[ 1 ];
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase1.err
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase1.err?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase1.err (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase1.err Sat Jul 17 18:38:59 2010
@@ -55,6 +55,7 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - ExtensionBase::setPresent(): false
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - return IssuerAlternativeNameExt::valid() is true
@@ -68,17 +69,31 @@
DEBUG ca-mgm - return AuthorityInfoAccessExt::valid() is true
DEBUG ca-mgm - return CRLDistributionPointsExt::valid() is true
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
+DEBUG IniParser - Can not delete nsBaseUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
+DEBUG IniParser - Can not delete nsRevocationUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
+DEBUG IniParser - Can not delete nsCaRevocationUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
+DEBUG IniParser - Can not delete nsRenewalUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
+DEBUG IniParser - Can not delete nsCaPolicyUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
+DEBUG IniParser - Can not delete nsSslServerName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
+DEBUG IniParser - Can not delete extendedKeyUsage Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
@@ -87,9 +102,16 @@
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - return AuthorityInfoAccessExt::valid() is true
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
+DEBUG IniParser - Can not delete authorityInfoAccess Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return CRLDistributionPointsExt::valid() is true
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
+DEBUG IniParser - Can not delete crlDistributionPoints Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
+DEBUG IniParser - Can not delete certificatePolicies Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=5 result=ca
DEBUG ca-mgm - type2Section: type=5 result=ca
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
@@ -147,6 +169,8 @@
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - removeFile ./TestRepos/ca1_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf.tmpl did not change. Not saving.
DEBUG ca-mgm - Command: /usr/bin/openssl rsa -noout -in ./TestRepos//ca2_test/cacert.key -passin env:PASSWORD
DEBUG ca-mgm - type2Section: type=5 result=ca
DEBUG ca-mgm - type2Section: type=5 result=ca
@@ -214,6 +238,7 @@
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - ExtensionBase::setPresent(): true
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - return IssuerAlternativeNameExt::valid() is true
@@ -251,6 +276,7 @@
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=5 result=ca
DEBUG ca-mgm - type2Section: type=5 result=ca
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
@@ -318,3 +344,5 @@
DEBUG ca-mgm - type2Section: type=5 result=v3_ca
DEBUG ca-mgm - ExtensionBase::setPresent(): true
DEBUG ca-mgm - removeFile ./TestRepos/ca2_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf.tmpl did not change. Not saving.
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase2.err
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase2.err?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase2.err (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase2.err Sat Jul 17 18:38:59 2010
@@ -53,6 +53,7 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - ExtensionBase::setPresent(): false
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - return IssuerAlternativeNameExt::valid() is true
@@ -66,17 +67,31 @@
DEBUG ca-mgm - return AuthorityInfoAccessExt::valid() is true
DEBUG ca-mgm - return CRLDistributionPointsExt::valid() is true
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsBaseUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsRevocationUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsCaRevocationUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsRenewalUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsCaPolicyUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsSslServerName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete extendedKeyUsage Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - type2Section: type=3 result=v3_client
@@ -85,9 +100,16 @@
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - return AuthorityInfoAccessExt::valid() is true
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete authorityInfoAccess Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return CRLDistributionPointsExt::valid() is true
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete crlDistributionPoints Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete certificatePolicies Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=client_cert
DEBUG ca-mgm - type2Section: type=3 result=client_cert
DEBUG ca-mgm - type2Section: type=3 result=v3_client
@@ -143,6 +165,8 @@
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - removeFile ./TestRepos/ca1_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf.tmpl did not change. Not saving.
DEBUG ca-mgm - Command: /usr/bin/openssl rsa -noout -in ./TestRepos//ca2_test/cacert.key -passin env:PASSWORD
DEBUG ca-mgm - type2Section: type=3 result=client_cert
DEBUG ca-mgm - type2Section: type=3 result=client_cert
@@ -197,6 +221,7 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - ExtensionBase::setPresent(): false
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - return IssuerAlternativeNameExt::valid() is true
@@ -212,17 +237,33 @@
DEBUG ca-mgm - return AuthorityInfoAccessExt::valid() is true
DEBUG ca-mgm - return CRLDistributionPointsExt::valid() is true
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsBaseUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsRevocationUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsCaRevocationUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsRenewalUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsCaPolicyUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete nsSslServerName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete basicConstraints Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete extendedKeyUsage Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - type2Section: type=3 result=v3_client
@@ -234,7 +275,12 @@
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - return CRLDistributionPointsExt::valid() is true
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete crlDistributionPoints Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=v3_client
+DEBUG IniParser - Can not delete certificatePolicies Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=3 result=client_cert
DEBUG ca-mgm - type2Section: type=3 result=client_cert
DEBUG ca-mgm - type2Section: type=3 result=v3_client
@@ -289,3 +335,5 @@
DEBUG ca-mgm - type2Section: type=3 result=v3_client
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - removeFile ./TestRepos/ca2_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf.tmpl did not change. Not saving.
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase3.err
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase3.err?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase3.err (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6/testcase3.err Sat Jul 17 18:38:59 2010
@@ -53,6 +53,7 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - ExtensionBase::setPresent(): false
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - return IssuerAlternativeNameExt::valid() is true
@@ -66,17 +67,31 @@
DEBUG ca-mgm - return AuthorityInfoAccessExt::valid() is true
DEBUG ca-mgm - return CRLDistributionPointsExt::valid() is true
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsBaseUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsRevocationUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsCaRevocationUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsRenewalUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsCaPolicyUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsSslServerName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete extendedKeyUsage Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - type2Section: type=4 result=v3_server
@@ -85,9 +100,16 @@
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - return AuthorityInfoAccessExt::valid() is true
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete authorityInfoAccess Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return CRLDistributionPointsExt::valid() is true
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete crlDistributionPoints Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete certificatePolicies Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=server_cert
DEBUG ca-mgm - type2Section: type=4 result=server_cert
DEBUG ca-mgm - type2Section: type=4 result=v3_server
@@ -143,6 +165,8 @@
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - removeFile ./TestRepos/ca1_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf.tmpl did not change. Not saving.
DEBUG ca-mgm - Command: /usr/bin/openssl rsa -noout -in ./TestRepos//ca2_test/cacert.key -passin env:PASSWORD
DEBUG ca-mgm - type2Section: type=4 result=server_cert
DEBUG ca-mgm - type2Section: type=4 result=server_cert
@@ -197,6 +221,7 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - ExtensionBase::setPresent(): false
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - return IssuerAlternativeNameExt::valid() is true
@@ -212,17 +237,33 @@
DEBUG ca-mgm - return AuthorityInfoAccessExt::valid() is true
DEBUG ca-mgm - return CRLDistributionPointsExt::valid() is true
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsBaseUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsRevocationUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsCaRevocationUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsRenewalUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsCaPolicyUrl Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete nsSslServerName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - return BasicConstraintsExt::valid() is true
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete basicConstraints Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete extendedKeyUsage Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - type2Section: type=4 result=v3_server
@@ -234,7 +275,12 @@
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - return CRLDistributionPointsExt::valid() is true
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete crlDistributionPoints Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=v3_server
+DEBUG IniParser - Can not delete certificatePolicies Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=4 result=server_cert
DEBUG ca-mgm - type2Section: type=4 result=server_cert
DEBUG ca-mgm - type2Section: type=4 result=v3_server
@@ -289,3 +335,5 @@
DEBUG ca-mgm - type2Section: type=4 result=v3_server
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - removeFile ./TestRepos/ca2_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf.tmpl did not change. Not saving.
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA7.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA7.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA7.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA7.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include <iostream>
@@ -14,7 +10,7 @@
// FIXME: need to be removed
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -27,18 +23,12 @@
exit( 1 );
}
- StringArray comp;
- comp.push_back("ca-mgm");
- comp.push_back("limal");
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CA7",
- comp,
- LogAppender::ALL_CATEGORIES,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_DEBUG );
+ logger.logToStdErr();
std::string file = argv[ 1 ];
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA7/testcase1.err
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA7/testcase1.err?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA7/testcase1.err (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA7/testcase1.err Sat Jul 17 18:38:59 2010
@@ -5,6 +5,7 @@
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=6 result=ca
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - return IssuerAlternativeNameExt::valid() is true
DEBUG ca-mgm - type2Section: type=6 result=ca
@@ -14,6 +15,9 @@
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
DEBUG ca-mgm - return IssuerAlternativeNameExt::valid() is true
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
+DEBUG IniParser - Can not delete issuerAltName Key does not exist.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
DEBUG ca-mgm - ExtensionBase::setPresent(): true
@@ -21,6 +25,8 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): false
DEBUG ca-mgm - type2Section: type=6 result=ca
DEBUG ca-mgm - removeFile ./TestRepos/ca1_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca1_test/openssl.cnf.tmpl did not change. Not saving.
DEBUG ca-mgm - Command: /usr/bin/openssl rsa -noout -in ./TestRepos//ca2_test/cacert.key -passin env:PASSWORD
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
@@ -29,6 +35,7 @@
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
DEBUG ca-mgm - ExtensionBase::setPresent(): true
DEBUG ca-mgm - type2Section: type=6 result=ca
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - return AuthorityKeyIdentifierGenerateExt::valid() is true
DEBUG ca-mgm - return IssuerAlternativeNameExt::valid() is true
DEBUG ca-mgm - type2Section: type=6 result=ca
@@ -38,6 +45,7 @@
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
DEBUG ca-mgm - return IssuerAlternativeNameExt::valid() is true
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
DEBUG ca-mgm - type2Section: type=6 result=v3_crl
DEBUG ca-mgm - ExtensionBase::setPresent(): true
@@ -46,3 +54,5 @@
DEBUG ca-mgm - ExtensionBase::setPresent(): true
DEBUG ca-mgm - type2Section: type=6 result=ca
DEBUG ca-mgm - removeFile ./TestRepos/ca2_test/openssl.cnf
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf did not change. Not saving.
+DEBUG IniParser - File ./TestRepos//ca2_test/openssl.cnf.tmpl did not change. Not saving.
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA8.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA8.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA8.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA8.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -13,7 +9,7 @@
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -24,21 +20,12 @@
{
cout << "START" << endl;
- StringArray cat;
- cat.push_back("FATAL");
- cat.push_back("ERROR");
- cat.push_back("INFO");
- //cat.push_back("DEBUG");
-
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CA8",
- LogAppender::ALL_COMPONENTS,
- cat,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_INFO );
+ logger.logToStdErr();
RequestGenerationData rgd = CA::getRootCARequestDefaults("./TestRepos/");
CertificateIssueData cid = CA::getRootCAIssueDefaults("./TestRepos/");
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CA9.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CA9.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CA9.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CA9.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -13,7 +9,7 @@
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -27,13 +23,11 @@
cout << "START" << endl;
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CA9",
- LogAppender::ALL_COMPONENTS,
- LogAppender::ALL_CATEGORIES,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_DEBUG );
+ logger.logToStdErr();
cout << "=================== start CA List ======================" << endl;
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CAConfig.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CAConfig.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CAConfig.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CAConfig.cc Sat Jul 17 18:38:59 2010
@@ -1,17 +1,13 @@
-#include
-#include
-#include
-#include
#include
-#include
+#include
#include
#include <iostream>
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -21,19 +17,17 @@
cout << "START" << endl;
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CAConfig",
- LogAppender::ALL_COMPONENTS,
- LogAppender::ALL_CATEGORIES,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_DEBUG );
+ logger.logToStdErr();
CAConfig *config = new CAConfig("openssl.cnf.tmpl");
CAConfig *configNew = config->clone("openssl.cnf.tmpl.test");
- LIMAL_SLOG(ca_mgm::Logger("ca-mgm"),
- "DEBUG", "file openssl.cnf.tmpl.test parsed.");
+ _DBG("ca-mgm") << "file openssl.cnf.tmpl.test parsed.";
configNew->setValue ("v3_req_server", "basicConstraints", "CA:TRUE");
configNew->deleteValue ("v3_req_server", "keyUsage");
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CRLTest.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CRLTest.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CRLTest.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CRLTest.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,7 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
+#include
#include
#include
@@ -12,7 +9,7 @@
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -23,20 +20,12 @@
{
cout << "START" << endl;
- StringArray cat;
- cat.push_back("FATAL");
- cat.push_back("ERROR");
- cat.push_back("INFO");
- //cat.push_back("DEBUG");
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CRLTest",
- LogAppender::ALL_COMPONENTS,
- cat,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_INFO );
+ logger.logToStdErr();
CA ca("Test_CA1", "system", "./TestRepos/");
CRLGenerationData cgd = ca.getCRLDefaults();
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -13,7 +9,7 @@
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -24,20 +20,12 @@
{
cout << "START" << endl;
- StringArray cat;
- cat.push_back("FATAL");
- cat.push_back("ERROR");
- cat.push_back("INFO");
- //cat.push_back("DEBUG");
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CertificateTest",
- LogAppender::ALL_COMPONENTS,
- cat,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_INFO );
+ logger.logToStdErr();
CA ca("Test_CA1", "system", "./TestRepos/");
RequestGenerationData rgd = ca.getRequestDefaults(E_Client_Req);
@@ -78,7 +66,7 @@
path::PathInfo pi("./TestRepos/Test_CA1/newcerts/" + c + ".pem");
- cout << "Certificate exists: " << Bool(pi.exists()) << endl;
+ cout << "Certificate exists: " << str::toString(pi.exists()) << endl;
cout << "DONE" << endl;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest2.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest2.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest2.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest2.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -13,7 +9,7 @@
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -24,20 +20,12 @@
{
cout << "START" << endl;
- StringArray cat;
- cat.push_back("FATAL");
- cat.push_back("ERROR");
- cat.push_back("INFO");
- //cat.push_back("DEBUG");
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CertificateTest2",
- LogAppender::ALL_COMPONENTS,
- cat,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_INFO );
+ logger.logToStdErr();
CA ca("Test_CA1", "system", "./TestRepos/");
RequestGenerationData rgd = ca.getRequestDefaults(E_Server_Req);
@@ -73,7 +61,7 @@
path::PathInfo pi("./TestRepos/Test_CA1/newcerts/" + c + ".pem");
- cout << "Certificate exists: " << Bool(pi.exists()) << endl;
+ cout << "Certificate exists: " << str::toString(pi.exists()) << endl;
cout << "DONE" << endl;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest3.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest3.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest3.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest3.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -13,7 +9,7 @@
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -24,20 +20,12 @@
{
cout << "START" << endl;
- StringArray cat;
- cat.push_back("FATAL");
- cat.push_back("ERROR");
- cat.push_back("INFO");
- //cat.push_back("DEBUG");
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CertificateTest3",
- LogAppender::ALL_COMPONENTS,
- cat,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_INFO );
+ logger.logToStdErr();
CA ca("Test_CA1", "system", "./TestRepos/");
RequestGenerationData rgd = ca.getRequestDefaults(E_Client_Req);
@@ -163,7 +151,7 @@
slp.push_back("http://www2.my-company.com/");
p2.setCpsURI(slp);
- std::list<Int32> num;
+ std::list num;
num.push_back(1);
num.push_back(5);
num.push_back(8);
@@ -214,7 +202,7 @@
path::PathInfo pi("./TestRepos/Test_CA1/newcerts/" + c + ".pem");
- cout << "Certificate exists: " << Bool(pi.exists()) << endl;
+ cout << "Certificate exists: " << str::toString(pi.exists()) << endl;
cout << "DONE" << endl;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest4.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest4.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest4.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest4.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -16,7 +12,7 @@
// FIXME: need to be removed
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -28,20 +24,12 @@
{
cout << "START" << endl;
- StringArray cat;
- cat.push_back("FATAL");
- cat.push_back("ERROR");
- cat.push_back("INFO");
- //cat.push_back("DEBUG");
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CertificateTest4",
- LogAppender::ALL_COMPONENTS,
- cat,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_INFO );
+ logger.logToStdErr();
CA ca("Test_CA1", "system", "./TestRepos/");
RequestGenerationData rgd = ca.getRequestDefaults(E_Client_Req);
@@ -165,7 +153,7 @@
slp.push_back("http://www2.my-company.com/");
p2.setCpsURI(slp);
- std::list<Int32> num;
+ std::list num;
num.push_back(1);
num.push_back(5);
num.push_back(8);
@@ -189,7 +177,7 @@
path::PathInfo pi("./TestRepos/Test_CA1/newcerts/" + c + ".pem");
- cout << "Certificate exists: " << Bool(pi.exists()) << endl;
+ cout << "Certificate exists: " << str::toString(pi.exists()) << endl;
CertificateData cd = ca.getCertificate(c);
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest5.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest5.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest5.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest5.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -13,7 +9,7 @@
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -25,20 +21,12 @@
{
cout << "START" << endl;
- StringArray cat;
- cat.push_back("FATAL");
- cat.push_back("ERROR");
- cat.push_back("INFO");
- //cat.push_back("DEBUG");
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CertificateTest5",
- LogAppender::ALL_COMPONENTS,
- cat,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_INFO );
+ logger.logToStdErr();
CA ca("Test_CA1", "system", "./TestRepos/");
RequestGenerationData rgd = ca.getRequestDefaults(E_Client_Req);
@@ -116,7 +104,7 @@
path::PathInfo pi("./TestRepos/Test_CA1/newcerts/" + c + ".pem");
- cout << "Certificate exists: " << Bool(pi.exists()) << endl;
+ cout << "Certificate exists: " << str::toString(pi.exists()) << endl;
CertificateData cd = ca.getCertificate(c);
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest6.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest6.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest6.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest6.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -13,7 +9,7 @@
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -25,20 +21,12 @@
{
cout << "START" << endl;
- StringArray cat;
- cat.push_back("FATAL");
- cat.push_back("ERROR");
- cat.push_back("INFO");
- //cat.push_back("DEBUG");
-
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "CertificateTest6",
- LogAppender::ALL_COMPONENTS,
- cat,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_INFO );
+ logger.logToStdErr();
CA ca("Test_CA1", "system", "./TestRepos/");
RequestGenerationData rgd = ca.getRequestDefaults(E_Client_Req);
@@ -116,7 +104,7 @@
path::PathInfo pi("./TestRepos/Test_CA1/newcerts/" + c + ".pem");
- cout << "Certificate exists: " << Bool(pi.exists()) << endl;
+ cout << "Certificate exists: " << str::toString(pi.exists()) << endl;
CertificateData cd = ca.getCertificate(c);
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/ConvertTest.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/ConvertTest.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/ConvertTest.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/ConvertTest.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -17,7 +13,7 @@
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater2.hpp"
using namespace ca_mgm;
using namespace std;
@@ -30,21 +26,15 @@
{
cout << "START" << endl;
- StringArray cat;
- cat.push_back("FATAL");
- // do not log errors because the openssl errors include a pid which changes everytime
- //cat.push_back("ERROR");
- cat.push_back("INFO");
- //cat.push_back("DEBUG");
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "ConvertTest",
- LogAppender::ALL_COMPONENTS,
- cat,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater2());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ // TestLineFormater2 do not log errors because the openssl errors include
+ // a pid which changes everytime
+ logger.setLogLevel( logger::E_INFO );
+ logger.logToStdErr();
cout << "===================== Test x509Convert =====================" << endl;
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/DeleteCATest.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/DeleteCATest.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/DeleteCATest.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/DeleteCATest.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -14,7 +10,7 @@
#include <fstream>
#include
-using namespace blocxx;
+#include "TestLineFormater.hpp"
using namespace ca_mgm;
using namespace std;
@@ -26,13 +22,11 @@
cout << "START" << endl;
// Logging
- LoggerRef l = ca_mgm::Logger::createCerrLogger(
- "DeleteCATest",
- LogAppender::ALL_COMPONENTS,
- LogAppender::ALL_CATEGORIES,
- "%-5p %c - %m"
- );
- ca_mgm::Logger::setDefaultLogger(l);
+ shared_ptrLogControl::LineFormater formater(new TestLineFormater());
+ LogControl logger = LogControl::instance();
+ logger.setLineFormater( formater );
+ logger.setLogLevel( logger::E_DEBUG );
+ logger.logToStdErr();
// fake the index.txt
path::copyFile("./TestRepos/Test_CA1/index.txt",
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/ExportTest.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/ExportTest.cc?rev=2689&r1=2688&r2=2689&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/ExportTest.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/ExportTest.cc Sat Jul 17 18:38:59 2010
@@ -1,10 +1,6 @@
-#include
-#include
-#include
-#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -16,7 +12,7 @@
#include <fstream>
#include