Trouble propagating logging configuration

Loris Bennett loris.bennett at fu-berlin.de
Tue Aug 31 09:38:18 EDT 2021


"Loris Bennett" <loris.bennett at fu-berlin.de> writes:

> Hi,
>
> I am having difficulty getting the my logging configuration passed on
> to imported modules.
>
> My initial structure was as follows:
>
>   $ tree blorp/
>   blorp/
>   |-- blorp
>   |   |-- __init__.py
>   |   |-- bar.py
>   |   |-- foo.py
>   |   `-- main.py
>   `-- pyproject.toml
>
> whereby the logging configuration is done in main.py.
>
> After thinking about it, I decided maybe the inheritance wasn't working
> because main.py is in the same directory as the other files.  So I
> changed the structure to
>
>   $ tree blorp/
>   blorp/
>   |-- blorp
>   |   |-- __init__.py
>   |   |-- bar.py
>   |   `-- foo.py
>   |-- main.py
>   `-- pyproject.toml
>
> but the logging configuration still is not propagated.
>
> Can anyone at least confirm that moving main.py to the directory above
> the other files is the correct thing to do and thus the problem is being
> caused by something else?

I should mention that I am using poetry and thus the program is called
via an entry in the pyproject.toml file such as 

  [tool.poetry.scripts]
  blorp_out = "main:blorp_out"

I have a suspicion that this way of calling the program somehow
interferes with the inheritance mechanism used by logging.

Cheers,

Loris

-- 
This signature is currently under construction.


More information about the Python-list mailing list