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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joshua
zodb
Commits
d45c861b
Commit
d45c861b
authored
Apr 17, 2004
by
Gintautas Miliauskas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to use logging instead of zLOG.
parent
5c801ecc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
15 deletions
+19
-15
src/ZODB/DB.py
src/ZODB/DB.py
+5
-3
src/ZODB/ExportImport.py
src/ZODB/ExportImport.py
+5
-4
src/ZODB/FileStorage/format.py
src/ZODB/FileStorage/format.py
+5
-2
src/ZODB/lock_file.py
src/ZODB/lock_file.py
+4
-6
No files found.
src/ZODB/DB.py
View file @
d45c861b
...
...
@@ -13,20 +13,22 @@
##############################################################################
"""Database objects
$Id: DB.py,v 1.7
5 2004/04/15 16:41:42 jeremy
Exp $"""
$Id: DB.py,v 1.7
6 2004/04/17 23:04:52 gintautasm
Exp $"""
import
cPickle
,
cStringIO
,
sys
from
thread
import
allocate_lock
from
time
import
time
,
ctime
import
warnings
import
logging
from
ZODB.broken
import
find_global
from
ZODB.Connection
import
Connection
from
ZODB.serialize
import
referencesf
from
zLOG
import
LOG
,
ERROR
import
transaction
logger
=
logging
.
getLogger
(
'zodb.db'
)
class
DB
(
object
):
"""The Object Database
-------------------
...
...
@@ -601,7 +603,7 @@ class DB(object):
try
:
self
.
_storage
.
pack
(
t
,
referencesf
)
except
:
LOG
(
"ZODB"
,
ERROR
,
"packing"
,
error
=
sys
.
exc_info
()
)
logger
.
error
(
"packing"
,
exc_info
=
True
)
raise
def
setCacheSize
(
self
,
v
):
...
...
src/ZODB/ExportImport.py
View file @
d45c861b
...
...
@@ -16,13 +16,15 @@
from
cStringIO
import
StringIO
from
cPickle
import
Pickler
,
Unpickler
from
tempfile
import
TemporaryFile
import
logging
from
ZODB.POSException
import
ExportError
from
ZODB.utils
import
p64
,
u64
from
ZODB.serialize
import
referencesf
import
zLOG
import
sys
logger
=
logging
.
getLogger
(
'zodb.ExportImport'
)
class
ExportImport
:
def
exportFile
(
self
,
oid
,
f
=
None
):
...
...
@@ -43,9 +45,8 @@ class ExportImport:
try
:
p
,
serial
=
load
(
oid
,
self
.
_version
)
except
:
zLOG
.
LOG
(
"ZODB"
,
zLOG
.
DEBUG
,
"broken reference for oid %s"
%
`oid`
,
err
=
sys
.
exc_info
())
logger
.
debug
(
"broken reference for oid %s"
,
repr
(
oid
),
exc_info
=
True
)
else
:
referencesf
(
p
,
oids
)
f
.
writelines
([
oid
,
p64
(
len
(
p
)),
p
])
...
...
src/ZODB/FileStorage/format.py
View file @
d45c861b
...
...
@@ -124,10 +124,11 @@
# record.
import
struct
import
logging
from
ZODB.POSException
import
POSKeyError
from
ZODB.utils
import
u64
,
oid_repr
,
t32
from
zLOG
import
LOG
,
ERROR
class
CorruptedError
(
Exception
):
pass
...
...
@@ -159,6 +160,8 @@ DATA_VERSION_HDR_LEN = 58
assert
struct
.
calcsize
(
TRANS_HDR
)
==
TRANS_HDR_LEN
assert
struct
.
calcsize
(
DATA_HDR
)
==
DATA_HDR_LEN
logger
=
logging
.
getLogger
(
'zodb.FileStorage.format'
)
class
FileStorageFormatter
(
object
):
"""Mixin class that can read and write the low-level format."""
...
...
@@ -244,7 +247,7 @@ class FileStorageFormatter(object):
def
fail
(
self
,
pos
,
msg
,
*
args
):
s
=
(
"%s:%s:"
+
msg
)
%
((
self
.
_name
,
pos
)
+
args
)
LOG
(
"FS pack"
,
ERROR
,
s
)
logger
.
error
(
s
)
raise
CorruptedError
(
s
)
def
checkTxn
(
self
,
th
,
pos
):
...
...
src/ZODB/lock_file.py
View file @
d45c861b
...
...
@@ -15,6 +15,7 @@
import
os
import
errno
import
logging
logger
=
logging
.
getLogger
(
"ZODB.lock_file"
)
try
:
import
fcntl
...
...
@@ -23,10 +24,8 @@ except ImportError:
from
winlock
import
LockFile
as
_LockFile
from
winlock
import
UnlockFile
as
_UnlockFile
except
ImportError
:
import
zLOG
def
lock_file
(
file
):
zLOG
.
LOG
(
'ZODB'
,
zLOG
.
INFO
,
'No file-locking support on this platform'
)
logger
.
info
(
'No file-locking support on this platform'
)
# Windows
def
lock_file
(
file
):
...
...
@@ -46,9 +45,8 @@ else:
# File is automatically unlocked on close
pass
log
=
logging
.
getLogger
(
"LockFile"
)
# This is a better interface to use than the lockfile.lock_file() interface.
# Creating the instance acquires the lock. The file remains open. Calling
# close both closes and unlocks the lock file.
...
...
@@ -64,7 +62,7 @@ class LockFile:
try
:
lock_file
(
self
.
_fp
)
except
:
log
.
exception
(
"Error locking file %s"
%
path
)
log
ger
.
exception
(
"Error locking file %s"
,
path
)
raise
print
>>
self
.
_fp
,
os
.
getpid
()
self
.
_fp
.
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