Re: Windows Log txtfile

10bxjfhf <[email protected]> Fri, 6 Mar 2020 07:35:15 -0800
Newsgroups gmane.comp.video.graphicsmagick.apis
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============6050917401339550985==
Content-Type: multipart/alternative;
 boundary="------------F225007175B5E4791D73ADCF"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------F225007175B5E4791D73ADCF
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

On 2020-03-05 2:51 p.m., Bob Friesenhahn wrote:

> 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.
A possibility, which I might have considered in the end, but since the 
log.mgk represents, in effect, a  'global' configuration, I did not try that
>
> 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.
I've noticed that
>
>> 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?

As to your questions, I can only refer to other libraries I have worked 
with and compare how they 'do things'

One of the ones which I have used occasionally in my apps is libcurl - 
and of course libtiff, which I understand is a lib you also maintain.

As I have only used libtiff indirectly via the wxWidgets wrapers, I am 
not really familiar with it, but it does have

TIFFSetErrorHandler

Have I missed such a feature in magick++

libcurl returns error codes and it is up to the user to handle whichever 
he needs to

https://curl.haxx.se/libcurl/c/libcurl-errors.html

>
>> 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.

As the way to access the *.mgk files are set now, they are global to a 
PC - not very flexible.

Libcurl has a way to set individual option, whether magick needs to be 
or should be that flexible, I don't know,

but one way would be to pass a second path to InitializeMagick, 
specifying where to look for those configuration files.

As well, it could/should pass back some indication of what, if anything, 
went wrong. Even a plain true/false as a return code, with possibly 
either an error code or error string.

Win has this idea of GetLastError()

>
>> 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.
>
Oh my ;-)

from looking at the bug list, it seems you are the only one actively 
working on this project and there seems to very little activity on the 
Win side.

As I am mostly an 'ad hoc' guy and not too deep into design issues, I 
generally only see a need to do something and only with time find a way 
to generalize the implementation - and that only if I work with the code 
often enough to see the need, opportunity and importance of investing 
the time to change and test the 'fix/change'.

The things I am looking at are not just corrections of a bit of logic or 
'corner cases' and just how deep I need to get into the bowels of the 
code to come up with (easy) fixes??

Arnold

PS &FWIW, working on magick++ is already a detour from a detour from a 
detour .... ;-)



--------------F225007175B5E4791D73ADCF
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 2020-03-05 2:51 p.m., Bob
      Friesenhahn wrote:<br>
    </div>
    <br>
    <blockquote type="cite"
      cite="mid:[email protected]">If
      I install or copy the installation directory to a place on the
      drive where I have write permission, all is fine.
      <br>
      <blockquote type="cite">
        <br>
        Need to find a way to specify the path to the log file
        <br>
      </blockquote>
      <br>
      Did you try using a fully-qualified path in the filename string? 
      This is the obvious thing to do.
      <br>
    </blockquote>
    A possibility, which I might have considered in the end, but since
    the log.mgk represents, in effect, a  'global' configuration, I did
    not try that<br>
    <blockquote type="cite"
      cite="mid:[email protected]">
      <br>
      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.
      <br>
    </blockquote>
    I've noticed that <br>
    <blockquote type="cite"
      cite="mid:[email protected]">
      <br>
      <blockquote type="cite">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 :-( ;-)
        <br>
      </blockquote>
      <br>
      How do you prefer that the error be reported?  Is there a reliable
      way to report the error under Windows?
      <br>
    </blockquote>
    <p>As to your questions, I can only refer to other libraries I have
      worked with and compare how they 'do things'</p>
    <p>One of the ones which I have used occasionally in my apps is
      libcurl - and of course libtiff, which I understand is a lib you
      also maintain.</p>
    <p>As I have only used libtiff indirectly via the wxWidgets wrapers,
      I am not really familiar with it, but it does have <br>
    </p>
    <p><font face="Arial, Helvetica, Sans"><tt>TIFFSetErrorHandler</tt></font></p>
    <p>Have I missed such a feature in magick++<br>
    </p>
    <p>libcurl returns error codes and it is up to the user to handle
      whichever he needs to</p>
    <p><a class="moz-txt-link-freetext" href="https://curl.haxx.se/libcurl/c/libcurl-errors.html">https://curl.haxx.se/libcurl/c/libcurl-errors.html</a><br>
    </p>
    <blockquote type="cite"
      cite="mid:[email protected]">
      <br>
      <blockquote type="cite">PS: I very much would like to have a way
        for my app to inspect the configuration data, especially when
        debugging an app.
        <br>
      </blockquote>
      <br>
      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.
      <br>
    </blockquote>
    <p>As the way to access the *.mgk files are set now, they are global
      to a PC - not very flexible.</p>
    <p>Libcurl has a way to set individual option, whether magick needs
      to be or should be that flexible, I don't know,</p>
    <p>but one way would be to pass a second path to InitializeMagick,
      specifying where to look for those configuration files. <br>
    </p>
    <p>As well, it could/should pass back some indication of what, if
      anything, went wrong. Even a plain true/false as a return code,
      with possibly either an error code or error string.</p>
    <p>Win has this idea of GetLastError()<br>
    </p>
    <blockquote type="cite"
      cite="mid:[email protected]">
      <br>
      <blockquote type="cite">Please advise whether or not I should
        raise any of these as a bug report.
        <br>
      </blockquote>
      <br>
      Feel free.  Bug reports which include a well thought-out source
      code patch are best.
      <br>
      <br>
      You may notice that there are many bug reports already.  Bug
      reports which include easy to apply solutions will get priority.
      <br>
      <br>
    </blockquote>
    <p>Oh my ;-)</p>
    <p>from looking at the bug list, it seems you are the only one
      actively working on this project and there seems to very little
      activity on the Win side.</p>
    <p>As I am mostly an 'ad hoc' guy and not too deep into design
      issues, I generally only see a need to do something and only with
      time find a way to generalize the implementation - and that only
      if I work with the code often enough to see the need, opportunity
      and importance of investing the time to change and test the
      'fix/change'.</p>
    <p>The things I am looking at are not just corrections of a bit of
      logic or 'corner cases' and just how deep I need to get into the
      bowels of the code to come up with (easy) fixes??<br>
    </p>
    <p>Arnold</p>
    <p>PS &amp;FWIW, working on magick++ is already a detour from a
      detour from a detour .... ;-)<br>
    </p>
    <p><br>
    </p>
  </body>
</html>

--------------F225007175B5E4791D73ADCF--


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


--===============6050917401339550985==
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

--===============6050917401339550985==--