Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
d7105d0c
Commit
d7105d0c
authored
Jan 26, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge change from 2.3 branch
parent
774d4262
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
13 deletions
+41
-13
lib/python/App/special_dtml.py
lib/python/App/special_dtml.py
+1
-0
lib/python/ZLogger/stupidFileLogger.py
lib/python/ZLogger/stupidFileLogger.py
+40
-13
No files found.
lib/python/App/special_dtml.py
View file @
d7105d0c
...
...
@@ -188,6 +188,7 @@ class DTMLFile(Bindings, Explicit, ClassicHTMLFile):
# Someone called us.
push
(
cns
)
ns
.
level
=
cns
.
level
+
1
ns
.
this
=
cns
.
this
# Get their bindings. Copy the request reference
# forward, and include older keyword arguments in the
# current 'keyword_args' binding.
...
...
lib/python/ZLogger/stupidFileLogger.py
View file @
d7105d0c
...
...
@@ -82,12 +82,13 @@
# attributions are listed in the accompanying credits file.
#
##############################################################################
import
time
,
sys
,
string
,
os
import
time
,
sys
,
string
,
os
,
thread
from
zLOG
import
severity_string
,
log_time
,
format_exception
_stupid_dest
=
None
_stupid_severity
=
None
_stupid_format
=
None
_no_stupid_log
=
[]
format_exception_only
=
None
...
...
@@ -100,7 +101,7 @@ class stupidFileLogger:
def
stupid_log_write
(
subsystem
,
severity
,
summary
,
detail
,
error
):
# Check where to log
global
_stupid_dest
global
_stupid_dest
,
_stupid_format
if
_stupid_dest
is
None
:
if
os
.
environ
.
has_key
(
'STUPID_LOG_FILE'
):
f
=
os
.
environ
[
'STUPID_LOG_FILE'
]
...
...
@@ -111,6 +112,10 @@ def stupid_log_write(subsystem, severity, summary, detail, error):
else
:
_stupid_dest
=
_no_stupid_log
if
os
.
environ
.
has_key
(
'STUPID_LOG_FORMAT'
):
_stupid_format
=
os
.
environ
[
'STUPID_LOG_FORMAT'
]
# Check id to log
if
_stupid_dest
is
_no_stupid_log
:
return
...
...
@@ -121,17 +126,39 @@ def stupid_log_write(subsystem, severity, summary, detail, error):
if
severity
<
_stupid_severity
:
return
_stupid_dest
.
write
(
"------
\
n
"
"%s %s %s %s
\
n
%s"
%
(
log_time
(),
severity_string
(
severity
),
subsystem
,
summary
,
detail
,
)
)
if
_stupid_format
is
not
None
:
fmap
=
{
'time'
:
log_time
(),
'severity'
:
severity_string
(
severity
),
'subsystem'
:
subsystem
,
'summary'
:
summary
,
'detail'
:
detail
,
'thread'
:
thread
.
get_ident
()
}
try
:
s
=
_stupid_format
%
fmap
except
:
failedf
,
_stupid_format
=
_stupid_format
,
None
_stupid_dest
.
write
(
"------
\
n
%s %s zLOG Format string error
\
n
"
"The STUPID_LOG_FORMAT string '%s' "
"caused an error, so we won't use it.
\
n
"
%
(
fmap
[
'time'
],
severity_string
(
100
),
failedf
)
)
else
:
_stupid_dest
.
write
(
s
)
if
_stupid_format
is
None
:
_stupid_dest
.
write
(
"------
\
n
"
"%s %s %s %s
\
n
%s"
%
(
log_time
(),
severity_string
(
severity
),
subsystem
,
summary
,
detail
,
)
)
_stupid_dest
.
flush
()
...
...
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