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

Module 'logging' output nothing from a DLL #8931

Open
ccll opened this issue Sep 10, 2018 · 2 comments
Open

Module 'logging' output nothing from a DLL #8931

ccll opened this issue Sep 10, 2018 · 2 comments

Comments

@ccll
Copy link

ccll commented Sep 10, 2018

I have a Nim executable dynamically loaded a Nim DLL, logging from the main executable works fine, but nothing is output to stdout from the DLL.

Both the EXE and DLL are compiled with "-d:useNimRtl".

@ccll
Copy link
Author

ccll commented Sep 10, 2018

Further investigation show that the global threadvar 'level' is shared between EXE and DLL, but 'handlers' does not.

image

Change 'level' in EXE then print it in DLL show that the change does take effect.
But 'handlers' is always empty in the DLL.

@ccll
Copy link
Author

ccll commented Sep 10, 2018

Try to manually pass the loggers to DLL then addHandler() there, still not working as the multi-method (or RTTI) does not work cross DLL boundary.

Related:

  1. https://forum.nim-lang.org/t/630
  2. Cannot downcast a object passed to a dynamically loaded library #3900 Cannot downcast a object passed to a dynamically loaded library

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

No branches or pull requests

1 participant