SDK to be logged as config parameter (#3011)

* Add a parameter to indicate we are logging from the SDK as config instead of an app name

* improve docstring to mention the source
This commit is contained in:
Henrique Joaquim
2022-10-24 12:32:11 +01:00
committed by GitHub
parent b27adbbb25
commit b27d737043
3 changed files with 6 additions and 2 deletions

View File

@@ -62,6 +62,8 @@ LOGGING_ROLLING_CLOCK = bool(
# DEBUG = 10
# NOTSET = 0
LOGGING_VERBOSITY = int(os.getenv("OPENBB_LOGGING_VERBOSITY") or 20)
# LOGGING SUB APP
LOGGING_SUB_APP = os.getenv("OPENBB_LOGGING_SUB_APP") or "terminal"
# API Keys section

View File

@@ -51,7 +51,7 @@ class AppSettings:
):
"""
Args:
name (str): Name of the application.
name (str): Source of the application.
commit_hash (str): Commit hash of the current running code.
identifier (str): Unique key identifying a particular installation.
session_id (str): Key identifying a particular running session.

View File

@@ -11,6 +11,7 @@ from typing import Optional, Callable, List
import logging
from traceback import format_stack
import openbb_terminal.config_terminal as cfg
from openbb_terminal.rich_config import console
from openbb_terminal.reports.reports_controller import ReportController
from openbb_terminal.dashboards.dashboards_controller import DashboardsController
@@ -2380,7 +2381,8 @@ class Loader:
@staticmethod
def __initialize_logging():
setup_logging(app_name="gst_sdk")
cfg.LOGGING_SUB_APP = "sdk"
setup_logging()
log_all_settings()
@classmethod