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
edx
edx-platform
Commits
2f4bf5f6
Commit
2f4bf5f6
authored
Aug 01, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes to cms
* make logging work properly in cms, dev * fix a comment
parent
eedf62a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
cms/djangoapps/contentstore/views.py
+1
-1
cms/envs/dev.py
+6
-1
cms/envs/logsettings.py
+6
-5
No files found.
cms/djangoapps/contentstore/views.py
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
...
...
cms/envs/dev.py
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'
:
{
...
...
cms/envs/logsettings.py
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'
,
...
...
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