File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from datetime import date , datetime , timedelta
2- from logging import getLogger
32
3+ import structlog
44from dateutil .relativedelta import relativedelta
55from django .conf import settings
66from django .db .models import Q , Sum
2828from features .models import Feature
2929from organisations .models import Organisation , OrganisationSubscriptionInformationCache
3030
31- logger = getLogger ( __name__ )
31+ logger = structlog . get_logger ( "app_analytics" )
3232
3333
3434def get_usage_data (
@@ -67,7 +67,10 @@ def get_usage_data(
6767 labels_filter = labels_filter ,
6868 )
6969
70- logger .warning (constants .NO_ANALYTICS_DATABASE_CONFIGURED_WARNING )
70+ logger .warning (
71+ "no-analytics-database-configured" ,
72+ details = constants .NO_ANALYTICS_DATABASE_CONFIGURED_WARNING ,
73+ )
7174 return []
7275
7376
@@ -154,7 +157,10 @@ def get_feature_evaluation_data(
154157 labels_filter = labels_filter ,
155158 )
156159
157- logger .warning (constants .NO_ANALYTICS_DATABASE_CONFIGURED_WARNING )
160+ logger .warning (
161+ "no-analytics-database-configured" ,
162+ details = constants .NO_ANALYTICS_DATABASE_CONFIGURED_WARNING ,
163+ )
158164 return []
159165
160166
You can’t perform that action at this time.
0 commit comments