Re: Windows Log txtfile

Bob Friesenhahn <[email protected]> Thu, 5 Mar 2020 16:51:16 -0600 (CST)
Newsgroups gmane.comp.video.graphicsmagick.apis
Message-ID <[email protected]>
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--3735943886-1438311171-1583448676=:19876
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Thu, 5 Mar 2020, 10bxjfhf wrote:

> When I try to create a text log file under Windows, I have found a couple of 
> issues.
>
> <magicklog>
>   <log events="Warning" />
>   <log events="Error" />
>   <log events="FatalError" />
>   <log output="txtfile" />
>   <log filename="Magick-%d.log" />
>   <log generations="3" />
>   <log limit="2000" />
>   <log format="%t %r %u %p %m/%f/%l/%d/%s:\n  %e"  />
> </magicklog>
>
> a) When running the installed version of my app, the log file never appears, 
> probably because the app tries to write to the same directory as the 
> executable, but does not have the necessary permissions.
>
> No error is reported

Usually errors are reported via the log facility, which did not get 
configured correctly. :-(

> If I install or copy the installation directory to a place on the drive where 
> I have write permission, all is fine.
>
> Need to find a way to specify the path to the log file

Did you try using a fully-qualified path in the filename string?  This 
is the obvious thing to do.

As compared with other logging facilities I have used, the current 
logging to a file is a bit strange since it always starts the file 
from scratch and only rotates from within the same process.  There 
does not appear to be any forethought about how to handle multiple 
programs which may be writing to the same log.

> b) No error is reported if the 'txtfile' is 'misspelled', i.e. for 
> 'textfile', and no output either. Very hard to track down especially for a 
> newb, like myself :-( ;-)

How do you prefer that the error be reported?  Is there a reliable way 
to report the error under Windows?

> c) When running the app under the MSVC 2019 IDE, for either the debug or 
> release version, the log file appears in the parent directory of the 
> executeable directory; this may be a 'Windows MSVC' thing -

That seems strange.

> PS: I very much would like to have a way for my app to inspect the 
> configuration data, especially when debugging an app.

Such data is in a 'log_info' pointer (a pointer to LogInfo) in 
magick/log.c and this could be inspected using a debugger.  I have 
done everything possible to avoid exposing these internal structures 
to the outside world since it inhibits the ability to make changes. 
At one time it was likely exposed.

> Please advise whether or not I should raise any of these as a bug report.

Feel free.  Bug reports which include a well thought-out source code 
patch are best.

You may notice that there are many bug reports already.  Bug reports 
which include easy to apply solutions will get priority.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt
--3735943886-1438311171-1583448676=:19876
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--3735943886-1438311171-1583448676=:19876
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Graphicsmagick-apis mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-apis

--3735943886-1438311171-1583448676=:19876--