Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated messages from ql.nprint when using the library with absl-py #425

Closed
kqyang opened this issue Aug 6, 2020 · 6 comments · Fixed by #442
Closed

Duplicated messages from ql.nprint when using the library with absl-py #425

kqyang opened this issue Aug 6, 2020 · 6 comments · Fixed by #442

Comments

@kqyang
Copy link
Contributor

kqyang commented Aug 6, 2020

See abseil/abseil-py#148 for details.

Here is a sample output:

uname(0x800000fddb90) = 0
I0806 16:03:04.784489 139707194705728 core_utils.py:73] uname(0x800000fddb90) = 0

brk(0x0)
I0806 16:03:04.786140 139707194705728 core_utils.py:73] brk(0x0)

brk(0x1198200)
I0806 16:03:04.786884 139707194705728 core_utils.py:73] brk(0x1198200)

arch_prctl(0x11978c0) = 0
I0806 16:03:04.788332 139707194705728 core_utils.py:73] arch_prctl(0x11978c0) = 0

...

One workaround suggested by the developer of absl-py is to set propagate to False by default. I can create a PR for the change if you are ok with it.

@xwings
Copy link
Member

xwings commented Aug 8, 2020

I dont understand. So you want to create a PR for absl-py ?

@kqyang
Copy link
Contributor Author

kqyang commented Aug 10, 2020

@xwings Sorry for not making it clear. I'd like to set up the logger so it does not propagate to the root logger by default to avoid double printing, i.e.

diff --git i/qiling/utils.py w/qiling/utils.py
index 14373376..4b71c450 100644
--- i/qiling/utils.py
+++ w/qiling/utils.py
@@ -166,6 +166,7 @@ def ql_setup_logger(logger_name=None):
         logger_name = 'qiling_%s' % _counter

     logger = logging.getLogger(logger_name)
+    logger.propagate = False
     logger.setLevel(logging.DEBUG)
     return logger

@xwings
Copy link
Member

xwings commented Aug 11, 2020

@ucgJhe what do you think

@ucgJhe
Copy link
Collaborator

ucgJhe commented Aug 11, 2020

since we don't use propagation mechanism in qiling for now, disable it should be fine.

@xwings
Copy link
Member

xwings commented Aug 13, 2020

@kqyang a PR maybe ?

kqyang added a commit to kqyang/qiling that referenced this issue Aug 13, 2020
@kqyang
Copy link
Contributor Author

kqyang commented Aug 13, 2020

Done: #442.

@xwings xwings closed this as completed Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants