Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
looyolo
scrapy
提交
a75ad2bb
S
scrapy
项目概览
looyolo
/
scrapy
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
scrapy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a75ad2bb
编写于
11月 04, 2015
作者:
A
Akhil Lb
提交者:
Mikhail Korobov
12月 09, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
LOG_SHORT_NAMES option
上级
bd8c293a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
1 deletion
+18
-1
docs/topics/logging.rst
docs/topics/logging.rst
+5
-0
docs/topics/settings.rst
docs/topics/settings.rst
+10
-0
scrapy/settings/default_settings.py
scrapy/settings/default_settings.py
+1
-0
scrapy/utils/log.py
scrapy/utils/log.py
+2
-1
未找到文件。
docs/topics/logging.rst
浏览文件 @
a75ad2bb
...
...
@@ -150,6 +150,7 @@ These settings can be used to configure the logging:
* :setting:`LOG_FORMAT`
* :setting:`LOG_DATEFORMAT`
* :setting:`LOG_STDOUT`
* :setting:`LOG_SHORT_NAMES`
The first couple of settings define a destination for log messages. If
:setting:`LOG_FILE` is set, messages sent through the root logger will be
...
...
@@ -170,6 +171,10 @@ listed in `logging's logrecord attributes docs
<https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior>`_
respectively.
If :setting:`LOG_SHORT_NAMES` is set, then the logs will not display the scrapy
component that prints the log. It is unset by default, hence logs contain the
scrapy component responsible for that log output.
Command-line options
--------------------
...
...
docs/topics/settings.rst
浏览文件 @
a75ad2bb
...
...
@@ -788,6 +788,16 @@ If ``True``, all standard output (and error) of your process will be redirected
to the log. For example if you ``print 'hello'`` it will appear in the Scrapy
log.
.. setting:: LOG_SHORT_NAMES
LOG_SHORT_NAMES
____________
Default: ``False``
If ``True``, the logs will just contain the root path. If it is set to ``False``
then it displays the component responsible for the log output
.. setting:: MEMDEBUG_ENABLED
MEMDEBUG_ENABLED
...
...
scrapy/settings/default_settings.py
浏览文件 @
a75ad2bb
...
...
@@ -191,6 +191,7 @@ LOG_DATEFORMAT = '%Y-%m-%d %H:%M:%S'
LOG_STDOUT
=
False
LOG_LEVEL
=
'DEBUG'
LOG_FILE
=
None
LOG_SHORT_NAMES
=
False
SCHEDULER_DEBUG
=
False
...
...
scrapy/utils/log.py
浏览文件 @
a75ad2bb
...
...
@@ -118,7 +118,8 @@ def _get_handler(settings):
)
handler
.
setFormatter
(
formatter
)
handler
.
setLevel
(
settings
.
get
(
'LOG_LEVEL'
))
handler
.
addFilter
(
TopLevelFormatter
([
'scrapy'
]))
if
settings
.
getbool
(
'LOG_SHORT_NAMES'
):
handler
.
addFilter
(
TopLevelFormatter
([
'scrapy'
]))
return
handler
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录