Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
6a9b7e49
Commit
6a9b7e49
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
b7fcba1e
Changes
1
Show 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 @
6a9b7e49
...
@@ -85,19 +85,20 @@ class HandlerFactory(Factory):
...
@@ -85,19 +85,20 @@ class HandlerFactory(Factory):
Factory
.
__init__
(
self
)
Factory
.
__init__
(
self
)
self
.
section
=
section
self
.
section
=
section
def
create_logger
(
self
):
def
create_loghandler
(
self
):
raise
NotImplementedError
(
"subclasses must override create_logger()"
)
raise
NotImplementedError
(
"subclasses must override create_loghandler()"
)
def
create
(
self
):
def
create
(
self
):
import
logging
import
logging
logger
=
self
.
create_log
g
er
()
logger
=
self
.
create_log
handl
er
()
logger
.
setFormatter
(
logging
.
Formatter
(
self
.
section
.
format
,
logger
.
setFormatter
(
logging
.
Formatter
(
self
.
section
.
format
,
self
.
section
.
dateformat
))
self
.
section
.
dateformat
))
logger
.
setLevel
(
self
.
section
.
level
)
logger
.
setLevel
(
self
.
section
.
level
)
return
logger
return
logger
class
FileHandlerFactory
(
HandlerFactory
):
class
FileHandlerFactory
(
HandlerFactory
):
def
create_log
g
er
(
self
):
def
create_log
handl
er
(
self
):
from
zLOG.LogHandlers
import
StreamHandler
,
FileHandler
from
zLOG.LogHandlers
import
StreamHandler
,
FileHandler
path
=
self
.
section
.
path
path
=
self
.
section
.
path
if
path
==
"STDERR"
:
if
path
==
"STDERR"
:
...
@@ -138,13 +139,13 @@ def syslog_facility(value):
...
@@ -138,13 +139,13 @@ def syslog_facility(value):
return
value
return
value
class
SyslogHandlerFactory
(
HandlerFactory
):
class
SyslogHandlerFactory
(
HandlerFactory
):
def
create_log
g
er
(
self
):
def
create_log
handl
er
(
self
):
from
zLOG.LogHandlers
import
SysLogHandler
from
zLOG.LogHandlers
import
SysLogHandler
return
SysLogHandler
(
self
.
section
.
address
.
address
,
return
SysLogHandler
(
self
.
section
.
address
.
address
,
self
.
section
.
facility
)
self
.
section
.
facility
)
class
Win32EventLogFactory
(
HandlerFactory
):
class
Win32EventLogFactory
(
HandlerFactory
):
def
create_log
g
er
(
self
):
def
create_log
handl
er
(
self
):
from
zLOG.LogHandlers
import
Win32EventLogHandler
from
zLOG.LogHandlers
import
Win32EventLogHandler
return
Win32EventLogHandler
(
self
.
section
.
appname
)
return
Win32EventLogHandler
(
self
.
section
.
appname
)
...
@@ -177,13 +178,13 @@ def get_or_post(value):
...
@@ -177,13 +178,13 @@ def get_or_post(value):
return
value
return
value
class
HTTPHandlerFactory
(
HandlerFactory
):
class
HTTPHandlerFactory
(
HandlerFactory
):
def
create_log
g
er
(
self
):
def
create_log
handl
er
(
self
):
from
zLOG.LogHandlers
import
HTTPHandler
from
zLOG.LogHandlers
import
HTTPHandler
host
,
selector
=
self
.
section
.
url
host
,
selector
=
self
.
section
.
url
return
HTTPHandler
(
host
,
selector
,
self
.
section
.
method
)
return
HTTPHandler
(
host
,
selector
,
self
.
section
.
method
)
class
SMTPHandlerFactory
(
HandlerFactory
):
class
SMTPHandlerFactory
(
HandlerFactory
):
def
create_log
g
er
(
self
):
def
create_log
handl
er
(
self
):
from
zLOG.LogHandlers
import
SMTPHandler
from
zLOG.LogHandlers
import
SMTPHandler
host
,
port
=
self
.
section
.
smtp_server
host
,
port
=
self
.
section
.
smtp_server
if
not
port
:
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