pytogo / portforward

Kubernetes Port-Forward Go-Edition For Python
https://portforward.readthedocs.io
MIT License
17 stars 6 forks source link

Log message: "attempted to set a logger after the logging system was already initialized" #34

Closed reissseb closed 9 months ago

reissseb commented 10 months ago

Description

I was setting up a simple port forwarding to a Kubernetes pod. The forwarding works fine, but I get following message in the console output:

attempted to set a logger after the logging system was already initialized

The message also exists with a very simple script without any logging configuration and just using print().

Outcommenting the port forwarding does stop printing the above message to the console.

What I Did

import portforward

print("start")

with portforward.forward(
    "some-namespace",
    "some-pod-name",
    29092,
    9092,
    config_path=the_config_file,
):
  print("port forwarding active")

print("done")

console output:

start
port forwarding active
attempted to set a logger after the logging system was already initialized
done

Message is also printed with log_level=portforward.LogLevel.OFF

corka149 commented 9 months ago

(I am currently out of spare time but I hope to start working on this soon. But if anyone has interest in fixing it, just drop a note here.)