Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
edx-platform
Commits
c272f514
Commit
c272f514
authored
Oct 19, 2017
by
Calen Pennington
Committed by
Dillon Dumesnil
Oct 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move log_prefix up to be a class attribute
parent
f0771fbb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
openedx/core/djangoapps/schedules/resolvers.py
+3
-11
openedx/core/djangoapps/schedules/utils.py
+4
-1
No files found.
openedx/core/djangoapps/schedules/resolvers.py
View file @
c272f514
...
...
@@ -154,11 +154,7 @@ class ScheduleStartResolver(BinnedSchedulesBaseResolver):
"""
Send a message to all users whose schedule started at ``self.current_date`` + ``day_offset``.
"""
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
ScheduleStartResolver
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
log_prefix
=
'Scheduled Nudge'
log_prefix
=
'Scheduled Nudge'
def
schedule_bin
(
self
,
async_send_task
,
site_id
,
target_day_str
,
day_offset
,
bin_num
,
org_list
,
exclude_orgs
=
False
,
override_recipient_email
=
None
,
...
...
@@ -242,9 +238,7 @@ class UpgradeReminderResolver(BinnedSchedulesBaseResolver):
"""
Send a message to all users whose verified upgrade deadline is at ``self.current_date`` + ``day_offset``.
"""
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
UpgradeReminderResolver
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
log_prefix
=
'Upgrade Reminder'
log_prefix
=
'Upgrade Reminder'
def
schedule_bin
(
self
,
async_send_task
,
site_id
,
target_day_str
,
day_offset
,
bin_num
,
org_list
,
exclude_orgs
=
False
,
override_recipient_email
=
None
,
...
...
@@ -355,9 +349,7 @@ class CourseUpdateResolver(BinnedSchedulesBaseResolver):
Send a message to all users whose schedule started at ``self.current_date`` + ``day_offset`` and the
course has updates.
"""
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
CourseUpdateResolver
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
log_prefix
=
'Course Update'
log_prefix
=
'Course Update'
def
schedule_bin
(
self
,
async_send_task
,
site_id
,
target_day_str
,
day_offset
,
bin_num
,
org_list
,
exclude_orgs
=
False
,
override_recipient_email
=
None
,
...
...
openedx/core/djangoapps/schedules/utils.py
View file @
c272f514
...
...
@@ -6,9 +6,12 @@ LOG = logging.getLogger(__name__)
# TODO: consider using a LoggerAdapter instead of this mixin:
# https://docs.python.org/2/library/logging.html#logging.LoggerAdapter
class
PrefixedDebugLoggerMixin
(
object
):
log_prefix
=
None
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
PrefixedDebugLoggerMixin
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
log_prefix
=
self
.
__class__
.
__name__
if
self
.
log_prefix
is
None
:
self
.
log_prefix
=
self
.
__class__
.
__name__
def
log_debug
(
self
,
message
,
*
args
,
**
kwargs
):
LOG
.
debug
(
self
.
log_prefix
+
': '
+
message
,
*
args
,
**
kwargs
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment