On 15/03/2021 09:47, Robert Latest via Python-list wrote:
Richard Damon wrote:
On 3/8/21 4:16 AM, Robert Latest via Python-list wrote:
Joseph L. Casale wrote:
I couldn't find any information on how to implement logging in a library
that doesn't know the name of the application that uses it. Ho
Richard Damon wrote:
> On 3/8/21 4:16 AM, Robert Latest via Python-list wrote:
>> Joseph L. Casale wrote:
I couldn't find any information on how to implement logging in a library
that doesn't know the name of the application that uses it. How is that
done?
>>> That's not how it works
On 3/8/21 4:16 AM, Robert Latest via Python-list wrote:
> Joseph L. Casale wrote:
>>> I couldn't find any information on how to implement logging in a library
>>> that
>>> doesn't know the name of the application that uses it. How is that done?
>> That's not how it works, it is the opposite. You n
Joseph L. Casale wrote:
>> I couldn't find any information on how to implement logging in a library that
>> doesn't know the name of the application that uses it. How is that done?
>
> That's not how it works, it is the opposite. You need to know the name of its
> logger, and since you imported it,
"Joseph L. Casale" writes:
>> I couldn't find any information on how to implement logging in a
>> library that doesn't know the name of the application that uses
>> it. How is that done?
> Create (get) a root logger (you don't have to use it) and set the
> level, and attach a handler to it. Then
> I couldn't find any information on how to implement logging in a library that
> doesn't know the name of the application that uses it. How is that done?
Hello,
That's not how it works, it is the opposite. You need to know the name of its
logger,
and since you imported it, you do.
Logging is hi
Robert Latest wrote at 2021-3-7 10:21 GMT:
>I'm trying to add logging to a module that gets imported by another module. But
>I only get it to work right if the imported module knows the name of the
>importing module. The example given in the "Logging Cookbook" also rely on this
>fact.
I have used