Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/ Set profile on identify #5102

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions openbb_terminal/core/log/generation/settings_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
2 changes: 2 additions & 0 deletions openbb_terminal/loggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
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,
Expand Down Expand Up @@ -188,6 +189,7 @@ def send(self, record: logging.LogRecord):
{
"email": get_current_user().profile.email,
"primaryUsage": get_current_user().profile.primary_usage,
**get_startup(),
},
)
openbb_posthog.alias(get_user_uuid(), app_settings.identifier)
Expand Down