logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Madhu Gowda <madhu.gowd...@yahoo.com>
Subject Re: LogString conversion
Date Tue, 13 May 2008 09:14:34 GMT
<table cellspacing='0' cellpadding='0' border='0' ><tr><td style='font: inherit;'><P>Hi,</P>
<P>I am using log4cxx0.10.0 on windows XP, with Visual Studio 2005.</P>
<P>and the Configuration Properties are default as follows:</P>
<P>Configuration Type: Application(.exe)</P>
<P>Use of MFC: Use standard windows library</P>
<P>Use of ATL: Not using ATL</P>
<P>Minimize CRT use in ATL: No</P>
<P>Character set: Not set</P>
<P>Common Language Runtime support: No Common Language Runtime support</P>
<P>Whole Program Optimization: No Whole Program Optimization</P>
<P>and the Debugger type is Auto</P>
<P>Madhu Gowda<BR><BR>--- On <B>Mon, 5/12/08, Curt Arnold <I>&lt;carnold@apache.org&gt;</I></B>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px
solid">From: Curt Arnold &lt;carnold@apache.org&gt;<BR>Subject: Re: LogString
conversion<BR>To: "Log4CXX User" &lt;log4cxx-user@logging.apache.org&gt;<BR>Date:
Monday, May 12, 2008, 5:29 PM<BR><BR><PRE>On May 12, 2008, at 9:15 AM, Madhu
Gowda wrote:

&gt; Hi,
&gt; I tried the following in my sample program.
&gt; std::string sLogFile = "TestLog.txt";
&gt; LogString sFileName;
&gt; log4cxx::helpers::Transcoder::decode( sLogFile, sFileName);
&gt; But, it gives the sFileName as "".
&gt; I tried to debug and saw that in the function
&gt; void Transcoder::decode(const std::string&amp; src, LogString&amp; dst) {
&gt; the value of src is coming as &lt;Bad Ptr&gt;
&gt; Kindly advise on this.
&gt; Regards,
&gt; Madhu Gowda

The transcoding code is the most sensitive to platform differences.   
The code path for transcoding on WIndows is very different from on  
Linux, for example.  To really be able to track down anything related  
to transcoding, it is essential to know the platform, compiler and  
build options.

Also, you are reporting something regarding a particular debugger's  
display rendering of a particular STL libraries std::string class.   
None of that is specific to log4cxx and is very specific to the  
debugger and STL library in use.  It may be that src is perfectly  
usable, just that it is not being displayed the way you'd like.

Did you run the unit test suite?  TimeBasedRollingTest fails  
occasionally, but all the other tests should pass.  If there is a  
problem with encoding and decoding on your platform, it would likely  
come up in the unit tests and it would be a lot easier to diagnose and  

However, since you don't have any non-ASCII characters in your source  
string, decoding should be as simple as copying character by character  
into the destination.  What happens when you single step through the  


View raw message