Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Nicolas Wavrant
ZODB
Commits
4facbcd8
Commit
4facbcd8
authored
Jan 23, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In HandlerFactory and subclasses, use more reasonable method names.
parent
2611dd11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
src/zLOG/datatypes.py
src/zLOG/datatypes.py
+9
-8
No files found.
src/zLOG/datatypes.py
View file @
4facbcd8
...
...
@@ -85,19 +85,20 @@ class HandlerFactory(Factory):
Factory
.
__init__
(
self
)
self
.
section
=
section
def
create_logger
(
self
):
raise
NotImplementedError
(
"subclasses must override create_logger()"
)
def
create_loghandler
(
self
):
raise
NotImplementedError
(
"subclasses must override create_loghandler()"
)
def
create
(
self
):
import
logging
logger
=
self
.
create_log
g
er
()
logger
=
self
.
create_log
handl
er
()
logger
.
setFormatter
(
logging
.
Formatter
(
self
.
section
.
format
,
self
.
section
.
dateformat
))
logger
.
setLevel
(
self
.
section
.
level
)
return
logger
class
FileHandlerFactory
(
HandlerFactory
):
def
create_log
g
er
(
self
):
def
create_log
handl
er
(
self
):
from
zLOG.LogHandlers
import
StreamHandler
,
FileHandler
path
=
self
.
section
.
path
if
path
==
"STDERR"
:
...
...
@@ -138,13 +139,13 @@ def syslog_facility(value):
return
value
class
SyslogHandlerFactory
(
HandlerFactory
):
def
create_log
g
er
(
self
):
def
create_log
handl
er
(
self
):
from
zLOG.LogHandlers
import
SysLogHandler
return
SysLogHandler
(
self
.
section
.
address
.
address
,
self
.
section
.
facility
)
class
Win32EventLogFactory
(
HandlerFactory
):
def
create_log
g
er
(
self
):
def
create_log
handl
er
(
self
):
from
zLOG.LogHandlers
import
Win32EventLogHandler
return
Win32EventLogHandler
(
self
.
section
.
appname
)
...
...
@@ -177,13 +178,13 @@ def get_or_post(value):
return
value
class
HTTPHandlerFactory
(
HandlerFactory
):
def
create_log
g
er
(
self
):
def
create_log
handl
er
(
self
):
from
zLOG.LogHandlers
import
HTTPHandler
host
,
selector
=
self
.
section
.
url
return
HTTPHandler
(
host
,
selector
,
self
.
section
.
method
)
class
SMTPHandlerFactory
(
HandlerFactory
):
def
create_log
g
er
(
self
):
def
create_log
handl
er
(
self
):
from
zLOG.LogHandlers
import
SMTPHandler
host
,
port
=
self
.
section
.
smtp_server
if
not
port
:
...
...
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