Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
celery-haystack-ng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Colin Watson
celery-haystack-ng
Commits
8e7b1cef
Commit
8e7b1cef
authored
12 years ago
by
Jannis Leidel
Browse files
Options
Downloads
Patches
Plain Diff
Set task logger to log with debug in debug mode.
parent
a0a0c12d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
celery_haystack/tasks.py
+13
-0
13 additions, 0 deletions
celery_haystack/tasks.py
celery_haystack/test_settings.py
+2
-0
2 additions, 0 deletions
celery_haystack/test_settings.py
with
15 additions
and
0 deletions
celery_haystack/tasks.py
+
13
−
0
View file @
8e7b1cef
import
logging
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.management
import
call_command
from
django.db.models.loading
import
get_model
...
...
@@ -28,6 +29,12 @@ class CeleryHaystackSignalHandler(Task):
max_retries
=
settings
.
CELERY_HAYSTACK_MAX_RETRIES
default_retry_delay
=
settings
.
CELERY_HAYSTACK_RETRY_DELAY
def
get_logger
(
self
,
*
args
,
**
kwargs
):
logger
=
super
(
CeleryHaystackSignalHandler
,
self
).
get_logger
(
*
args
,
**
kwargs
)
if
settings
.
DEBUG
:
logger
.
setLogger
(
logging
.
DEBUG
)
return
logger
def
split_identifier
(
self
,
identifier
,
**
kwargs
):
"""
Break down the identifier representing the instance.
...
...
@@ -157,6 +164,12 @@ class CeleryHaystackUpdateIndex(Task):
A celery task class to be used to call the update_index management
command from Celery.
"""
def
get_logger
(
self
,
*
args
,
**
kwargs
):
logger
=
super
(
CeleryHaystackUpdateIndex
,
self
).
get_logger
(
*
args
,
**
kwargs
)
if
settings
.
DEBUG
:
logger
.
setLogger
(
logging
.
DEBUG
)
return
logger
def
run
(
self
,
apps
=
None
,
**
kwargs
):
logger
=
self
.
get_logger
(
**
kwargs
)
defaults
=
{
...
...
This diff is collapsed.
Click to expand it.
celery_haystack/test_settings.py
+
2
−
0
View file @
8e7b1cef
import
os
DEBUG
=
True
TEST_ROOT
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
tests
'
))
INSTALLED_APPS
=
[
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment