[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issues with gb.logging Logger, cannot _free
[Thread Prev] | [Thread Next]
- Subject: Re: Issues with gb.logging Logger, cannot _free
- From: T Lee Davidson <t.lee.davidson@xxxxxxxxx>
- Date: Fri, 12 Apr 2024 10:43:45 -0400
- To: user@xxxxxxxxxxxxxxxxxxxxxx
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] ----
Issues with gb.logging Logger, cannot _free | T Lee Davidson <t.lee.davidson@xxxxxxxxx> |
Re: Issues with gb.logging Logger, cannot _free | Bruce Steers <bsteers4@xxxxxxxxx> |