feature/ Set profile on identify (#5102)

* set user profile on identify

* Update loggers.py
This commit is contained in:
teh_coderer
2023-06-06 15:11:45 -04:00
committed by GitHub
parent a311ce4686
commit f42b9e87ba
2 changed files with 11 additions and 10 deletions

View File

@@ -68,13 +68,12 @@ def log_preferences() -> None:
def log_startup() -> None:
"""Combined logging of all settings"""
logger.info(
"STARTUP: %s ",
json.dumps(
{
"PREFERENCES": get_current_user().preferences.to_dict(),
"KEYS": get_credentials(),
"SYSTEM": get_system(),
}
),
)
logger.info("STARTUP: %s ", json.dumps(get_startup()))
def get_startup():
return {
"PREFERENCES": get_current_user().preferences.to_dict(),
"KEYS": get_credentials(),
"SYSTEM": get_system(),
}

View File

@@ -35,6 +35,7 @@ from openbb_terminal.core.log.generation.settings import (
LogSettings,
Settings,
)
from openbb_terminal.core.log.generation.settings_logger import get_startup
from openbb_terminal.core.log.generation.user_logger import (
NO_USER_PLACEHOLDER,
get_current_user,
@@ -188,6 +189,7 @@ class PosthogHandler(logging.Handler):
{
"email": get_current_user().profile.email,
"primaryUsage": get_current_user().profile.primary_usage,
**get_startup(),
},
)
openbb_posthog.alias(get_user_uuid(), app_settings.identifier)