Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
5f34bd61
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5f34bd61
编写于
1月 12, 2010
作者:
J
José Valim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
As the other constants, RAILS_DEFAULT_LOGGER no more.
上级
c4e3344a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
33 deletion
+23
-33
railties/lib/rails.rb
railties/lib/rails.rb
+8
-13
railties/lib/rails/bootstrap.rb
railties/lib/rails/bootstrap.rb
+15
-20
未找到文件。
railties/lib/rails.rb
浏览文件 @
5f34bd61
...
...
@@ -32,11 +32,6 @@
module
Rails
autoload
:Bootstrap
,
'rails/bootstrap'
# Needs to be duplicated from Active Support since its needed before Active
# Support is available. Here both Options and Hash are namespaced to prevent
# conflicts with other implementations AND with the classes residing in Active Support.
# ---
# TODO: w0t?
class
<<
self
def
application
@@application
||=
nil
...
...
@@ -48,7 +43,7 @@ def application=(application)
# The Configuration instance used to configure the Rails environment
def
configuration
application
.
config
uration
application
.
config
end
def
initialize!
...
...
@@ -56,19 +51,19 @@ def initialize!
end
def
initialized?
@initialized
||
false
@
@
initialized
||
false
end
def
initialized
=
(
initialized
)
@initialized
||=
initialized
@
@
initialized
||=
initialized
end
def
logger
if
defined?
(
RAILS_DEFAULT_LOGGER
)
RAILS_DEFAULT_LOGGER
else
nil
end
@@logger
||=
nil
end
def
logger
=
(
logger
)
@@logger
=
logger
end
def
backtrace_cleaner
...
...
railties/lib/rails/bootstrap.rb
浏览文件 @
5f34bd61
...
...
@@ -69,28 +69,23 @@ def initialize(application)
end
initializer
:initialize_logger
do
# if the environment has explicitly defined a logger, use it
next
if
Rails
.
logger
unless
logger
=
config
.
logger
begin
logger
=
ActiveSupport
::
BufferedLogger
.
new
(
config
.
log_path
)
logger
.
level
=
ActiveSupport
::
BufferedLogger
.
const_get
(
config
.
log_level
.
to_s
.
upcase
)
if
Rails
.
env
.
production?
logger
.
auto_flushing
=
false
end
rescue
StandardError
=>
e
logger
=
ActiveSupport
::
BufferedLogger
.
new
(
STDERR
)
logger
.
level
=
ActiveSupport
::
BufferedLogger
::
WARN
logger
.
warn
(
"Rails Error: Unable to access log file. Please ensure that
#{
config
.
log_path
}
exists and is chmod 0666. "
+
"The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
)
end
Rails
.
logger
||=
config
.
logger
||
begin
logger
=
ActiveSupport
::
BufferedLogger
.
new
(
config
.
log_path
)
logger
.
level
=
ActiveSupport
::
BufferedLogger
.
const_get
(
config
.
log_level
.
to_s
.
upcase
)
logger
.
auto_flushing
=
false
if
Rails
.
env
.
production?
logger
rescue
StandardError
=>
e
logger
=
ActiveSupport
::
BufferedLogger
.
new
(
STDERR
)
logger
.
level
=
ActiveSupport
::
BufferedLogger
::
WARN
logger
.
warn
(
"Rails Error: Unable to access log file. Please ensure that
#{
config
.
log_path
}
exists and is chmod 0666. "
+
"The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
)
logger
end
# TODO: W
hy are we silencing warning here?
silence_warnings
{
Object
.
const_set
"RAILS_DEFAULT_LOGGER"
,
logger
}
# TODO: W
rap it in a deprecation proxy
silence_warnings
{
Object
.
const_set
"RAILS_DEFAULT_LOGGER"
,
Rails
.
logger
}
end
# Sets the logger for Active Record, Action Controller, and Action Mailer
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录