Re: Finally have cleared the leaks ...

Bob Friesenhahn <[email protected]> Tue, 24 Mar 2020 16:47:13 -0500 (CDT)
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-1392712938-1585086433=:10606
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Tue, 24 Mar 2020, 10bxjfhf wrote:
>> 
>> Remember that the new SetLogDefault APIs are writing into a static storage 
>> location so they will not be influenced by InitializeMagick(). When 
>> InitializeMagick() is called, logging is initialized and the static default 
>> values should be used.  The static default values are only used during 
>> initialization.
>
> OK, I have traced through the code and the default log file name and path can 
> be set and it persists until some logevent is triggered, at which time it 
> reverts back to the default from log.mgk.
>
> I have not been able to find where or how the change back is triggered.

I don't see how that can be unless DestroyMagick() is called, and then 
InitializeMagickEx()/InitializeMagick().  That is the only logging 
initialization path.

Regardless, I do see that there is a 'log_configured' flag which was 
only set if log.mgk was loaded.  However, the log.mgk should only be 
loaded during the InitializeMagickEx() function call, and it should 
only do something once even if is called more than once.  If it is 
initializing more than once then that would be a serious problem.

I will set the 'log_configured' flag as a form of good-housekeeping.

> As a trial I tried to use SetLogDefaultOutputType before the call to 
> SetLogDefaultFileName, but I can't figure out how to specify the argument for 
> that function for TXTFileOutput

The argument accepted by SetLogDefaultFileName() should be the same as 
supported by "log.mgk" and can be any arbitrary file path.

The documentation also says:

"Place a %d in the file name in order to  support multiple log 
generations."

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-1392712938-1585086433=:10606
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--3735943886-1392712938-1585086433=:10606
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-1392712938-1585086433=:10606--