[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues with gb.logging Logger, cannot _free


On 4/12/24 05:14, Bruce Steers wrote:
I'm not sure about the problem you have killing the Logger object but it looks like you do not need to use Begin.

Calling _new() of Logger.class makes a new ComplexLogger object.
|$cLogger = New ComplexLogger(sFormat, tmpHandler)|
|
|
And the _new() function of ComplexLogger.class already runs the Begin() method so using hLogger.Begin() runs it again causing the error.

Strangeit has a Begin function but no End

Respects
BruceS


Thanks for the reply, BruceS.

Because the Wiki says that .Begin() needs to be called before logging anything, I had to look at the code again to see why the documentation would conflict with the code. Turns out, it doesn't seem to.

ComplexLogger's Begin() method is called /only/ if a LogHandler is not passed to its _new Sub in the sDefaultOutput parameter. And, if it were called twice, it would raise an error. So, I don't think that is the issue.

And, yes, perhaps "Begin" should be "Open". Other of the loggers use Open but have no Close as that appears to be handled internally.


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


References:
Issues with gb.logging Logger, cannot _freeT Lee Davidson <t.lee.davidson@xxxxxxxxx>
Re: Issues with gb.logging Logger, cannot _freeBruce Steers <bsteers4@xxxxxxxxx>