logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Abel" <stefan-a...@web.de>
Subject log4cxx and std::string
Date Fri, 12 Nov 2004 15:50:07 GMT
In my application I use std::string, but log4cxx uses log4cxx::String (std::basic_string).

How can I convert std::string to std::basic_string?

I tried the following workarround - it compiles, but it seems to have no effect.
Sometimes it produces fancy filenames like ^Ea

#ifdef WIN32
typedef wchar_t* LOG4CXXString;
#else
typedef log4cxx::String LOG4CXXString;
#endif

std::string filename = "logfile.log";
log4cxx::FileAppenderPtr appender = new log4cxx::FileAppender(layout, (LOG4CXXString) filename.c_str());
// compiles, but does not work

log4cxx::FileAppenderPtr appender = new log4cxx::FileAppender(layout, _T("logfile.log"));
// compiles and works

I'm using Microsoft Visual C++ 6

Any help is appreciated!

Stefan
________________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193


Mime
View raw message