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
9f506076
Commit
9f506076
authored
Oct 19, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reapplied forgotten patch from medusa migration from 2.3 to 2.4
parent
83b1f1b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
16 deletions
+24
-16
ZServer/medusa/m_syslog.py
ZServer/medusa/m_syslog.py
+12
-8
lib/python/ZServer/medusa/m_syslog.py
lib/python/ZServer/medusa/m_syslog.py
+12
-8
No files found.
ZServer/medusa/m_syslog.py
View file @
9f506076
...
...
@@ -137,20 +137,24 @@ facility_names = {
import
socket
class
syslog_client
:
def
__init__
(
self
,
address
=
'/dev/log'
):
self
.
address
=
address
if
type
(
address
)
==
type
(
''
):
self
.
socket
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
self
.
socket
.
connect
(
address
)
try
:
# APUE 13.4.2 specifes /dev/log as datagram socket
self
.
socket
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_DGRAM
)
self
.
socket
.
connect
(
address
)
except
:
# older linux may create as stream socket
self
.
socket
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
self
.
socket
.
connect
(
address
)
self
.
unix
=
1
else
:
self
.
socket
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
self
.
socket
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
self
.
unix
=
0
# curious: when talking to the unix-domain '/dev/log' socket, a
# zero-terminator seems to be required. this string is placed
# into a class variable so that it can be overridden if
# necessary.
log_format_string
=
'<%d>%s
\
000
'
...
...
lib/python/ZServer/medusa/m_syslog.py
View file @
9f506076
...
...
@@ -137,20 +137,24 @@ facility_names = {
import
socket
class
syslog_client
:
def
__init__
(
self
,
address
=
'/dev/log'
):
self
.
address
=
address
if
type
(
address
)
==
type
(
''
):
self
.
socket
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
self
.
socket
.
connect
(
address
)
try
:
# APUE 13.4.2 specifes /dev/log as datagram socket
self
.
socket
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_DGRAM
)
self
.
socket
.
connect
(
address
)
except
:
# older linux may create as stream socket
self
.
socket
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
self
.
socket
.
connect
(
address
)
self
.
unix
=
1
else
:
self
.
socket
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
self
.
socket
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
self
.
unix
=
0
# curious: when talking to the unix-domain '/dev/log' socket, a
# zero-terminator seems to be required. this string is placed
# into a class variable so that it can be overridden if
# necessary.
log_format_string
=
'<%d>%s
\
000
'
...
...
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