Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
2f4bf5f6
Commit
2f4bf5f6
authored
12 years ago
by
Victor Shnayder
Browse files
Options
Downloads
Patches
Plain Diff
Minor fixes to cms
* make logging work properly in cms, dev * fix a comment
parent
eedf62a1
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cms/djangoapps/contentstore/views.py
+1
-1
1 addition, 1 deletion
cms/djangoapps/contentstore/views.py
cms/envs/dev.py
+6
-1
6 additions, 1 deletion
cms/envs/dev.py
cms/envs/logsettings.py
+6
-5
6 additions, 5 deletions
cms/envs/logsettings.py
with
13 additions
and
7 deletions
cms/djangoapps/contentstore/views.py
+
1
−
1
View file @
2f4bf5f6
...
...
@@ -176,7 +176,7 @@ def load_preview_state(request, preview_id, location):
def
save_preview_state
(
request
,
preview_id
,
location
,
instance_state
,
shared_state
):
"""
Load
the state of a preview module to the request
Save
the state of a preview module to the request
preview_id (str): An identifier specifying which preview this module is used for
location: The Location of the module to dispatch to
...
...
This diff is collapsed.
Click to expand it.
cms/envs/dev.py
+
6
−
1
View file @
2f4bf5f6
...
...
@@ -2,13 +2,18 @@
This config file runs the simplest dev environment
"""
from
.common
import
*
from
.logsettings
import
get_logger_config
import
logging
import
sys
logging
.
basicConfig
(
stream
=
sys
.
stdout
,
)
DEBUG
=
True
TEMPLATE_DEBUG
=
DEBUG
LOGGING
=
get_logger_config
(
ENV_ROOT
/
"
log
"
,
logging_env
=
"
dev
"
,
tracking_filename
=
"
tracking.log
"
,
debug
=
True
)
MODULESTORE
=
{
'
default
'
:
{
...
...
This diff is collapsed.
Click to expand it.
cms/envs/logsettings.py
+
6
−
5
View file @
2f4bf5f6
...
...
@@ -3,19 +3,19 @@ import os.path
import
platform
import
sys
def
get_logger_config
(
log_dir
,
logging_env
=
"
no_env
"
,
def
get_logger_config
(
log_dir
,
logging_env
=
"
no_env
"
,
tracking_filename
=
None
,
syslog_addr
=
None
,
debug
=
False
):
"""
Return the appropriate logging config dictionary. You should assign the
result of this to the LOGGING var in your settings. The reason it
'
s done
result of this to the LOGGING var in your settings. The reason it
'
s done
this way instead of registering directly is because I didn
'
t want to worry
about resetting the logging state if this is called multiple times when
about resetting the logging state if this is called multiple times when
settings are extended.
"""
# If we're given an explicit place to put tracking logs, we do that (say for
# debugging). However, logging is not safe for multiple processes hitting
# debugging). However, logging is not safe for multiple processes hitting
# the same file. So if it's left blank, we dynamically create the filename
# based on the PID of this worker process.
if
tracking_filename
:
...
...
@@ -33,6 +33,7 @@ def get_logger_config(log_dir,
return
{
'
version
'
:
1
,
'
disable_existing_loggers
'
:
False
,
'
formatters
'
:
{
'
standard
'
:
{
'
format
'
:
'
%(asctime)s %(levelname)s %(process)d [%(name)s] %(filename)s:%(lineno)d - %(message)s
'
,
...
...
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