Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
settingsd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
settingsd
Commits
9e10d3ac
Commit
9e10d3ac
authored
Oct 05, 2010
by
Devaev Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added signal tracing, calls stack trace
parent
1d298cf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
service.py
settingsd/service.py
+17
-6
No files found.
settingsd/service.py
View file @
9e10d3ac
...
...
@@ -81,13 +81,24 @@ class ActionObject(CustomObject) :
##### Private decorators #####
def
tracer
(
function
)
:
def
tracer
(
function
,
statics_list
=
[
0
]
)
:
def
wrapper
(
self
,
*
args_list
,
**
kwargs_dict
)
:
return_value
=
function
(
self
,
*
args_list
,
**
kwargs_dict
)
if
config
.
value
(
config
.
APPLICATION_SECTION
,
"log_level"
)
==
const
.
LOG_LEVEL_DEBUG
:
logger
.
debug
(
"Called
\"
%
s::
%
s
\"
with args (
%
s,
%
s) -->
%
s"
%
(
self
.
__class__
.
__name__
,
function
.
__name__
,
str
(
args_list
),
str
(
kwargs_dict
),
str
(
return_value
)
))
return
return_value
logger
.
debug
(
"
%
s
%
s
%
s::
%
s"
%
(
" "
*
statics_list
[
0
],
str
((
function
.
__dict__
.
has_key
(
"_dbus_is_method"
)
and
"Called method"
)
or
(
function
.
__dict__
.
has_key
(
"_dbus_is_signal"
)
and
"Emited signal"
)),
self
.
_object_path
,
dbus_tools
.
joinMethod
(
function
.
_dbus_interface
,
function
.
__name__
)
))
statics_list
[
0
]
+=
1
return_value
=
function
(
self
,
*
args_list
,
**
kwargs_dict
)
statics_list
[
0
]
-=
1
logger
.
debug
(
"
%
s... executed as
%
s::
%
s(
%
s,
%
s) -->
%
s"
%
(
" "
*
statics_list
[
0
],
self
.
__class__
.
__name__
,
function
.
__name__
,
str
(
args_list
),
str
(
kwargs_dict
),
str
(
return_value
)
))
return
return_value
else
:
return
function
(
self
,
*
args_list
,
**
kwargs_dict
)
wrapper
.
__name__
=
function
.
__name__
wrapper
.
__dict__
=
function
.
__dict__
...
...
@@ -118,7 +129,7 @@ def actionsMethod(interface_name) :
def
customSignal
(
interface_name
)
:
def
decorator
(
function
)
:
return
dbus
.
service
.
signal
(
interface_name
)(
function
)
return
tracer
(
dbus
.
service
.
signal
(
interface_name
)(
function
)
)
return
decorator
def
functionSignal
(
interface_name
)
:
...
...
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