mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
feature/ Set profile on identify (#5102)
* set user profile on identify * Update loggers.py
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user