You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
#Override Client class to prevent file logger from being created
from pyvcloud.vcd.client import Client as _Client
class Client(_Client):
def _get_default_logger(self, file_name=None, log_level=logging.DEBUG):
self._logger = logging.getLogger(file_name)
self._logger.setLevel(log_level)
#Override get_logger function in pyvcloud.vdc.client to prevent file logger from being created
def _get_logger(file_name=None, log_level=logging.DEBUG):
LOGGER = logging.getLogger(file_name)
LOGGER.setLevel(log_level)
return LOGGER
import pyvcloud.vcd.client
pyvcloud.vcd.client.get_logger = _get_logger
Import VApp from pyvcloud.vcd.vapp after the workaround code to prevent the log file vcd_sdk.log from being created.
The text was updated successfully, but these errors were encountered:
By using the pyvcloud.vcd.client.Client class a default log file is created as
vcd_pysdk.log
.Importing
VApp
frompyvcloud.vcd.vapp
also creates a log file calledvcd_sdk.log
.This occurs due to the RotatingFileHandler which are created and registered to the
logger
object.Desired behavior:
file_name
is not given, or given asNone
, no RotatingFileHandler should be initialized and registered.Currently this is not possible due to:
and
which points to
client.py
:As workaround I use in my code:
Import
VApp
frompyvcloud.vcd.vapp
after the workaround code to prevent the log filevcd_sdk.log
from being created.The text was updated successfully, but these errors were encountered: