Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
multitouch
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
multitouch
Commits
5ca9a829
Commit
5ca9a829
authored
Apr 24, 2012
by
UVA Multi-touch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logger identifiers now all have the same length.
parent
9e95bdd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/logger.py
src/logger.py
+4
-1
No files found.
src/logger.py
View file @
5ca9a829
#import time
#import time
_id_len
=
0
class
Logger
(
object
):
class
Logger
(
object
):
def
__init__
(
self
,
**
kwargs
):
def
__init__
(
self
,
**
kwargs
):
global
_id_len
self
.
identifier
=
kwargs
.
get
(
'identifier'
,
self
.
identifier
=
kwargs
.
get
(
'identifier'
,
self
.
__class__
.
__name__
)
self
.
__class__
.
__name__
)
self
.
verbose
=
kwargs
.
get
(
'verbose'
,
0
)
self
.
verbose
=
kwargs
.
get
(
'verbose'
,
0
)
_id_len
=
max
(
_id_len
,
len
(
self
.
identifier
))
def
log
(
self
,
msg
,
verbosity
=
1
):
def
log
(
self
,
msg
,
verbosity
=
1
):
# TODO: log time
# TODO: log time
if
self
.
verbose
>=
verbosity
:
if
self
.
verbose
>=
verbosity
:
print
'| %s | %s'
%
(
self
.
identifier
,
msg
)
print
'| %s | %s'
%
(
'%%-%ds'
%
_id_len
%
self
.
identifier
,
msg
)
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