Thoughts on piggybacking on the Neotest logger? #422
-
Hey @rcarriga, I'm making great progress with my Go adapter and I'm now feeling the need of being able to log to file. Would it be advisable to tap into the Neotest logger and if so, do you see any possibility to distinguish logs made from Neotest vs the adapter in a good way (by e.g. a prefix in the log entry or similar)? local logger = require("neotest.logging")
logger.info("hello from the adapter") The obvious option is to of course manage a separate log file for the adapter. I just thought it could be interesting to keep all data in the same file, making it more easy to follow everything that goes on with both Neotest and any adapters that might be logging. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Since I'm lazy 😉 I'm implementing this here now: fredrikaverpil/neotest-golang#138 |
Beta Was this translation helpful? Give feedback.
-
So far that's what I've seen other adapters doing, and it's what I do in my Pest adapter for PHP: https://github.com/V13Axel/neotest-pest/blob/b665a4881c706eea476fcaf79a21996e9b65514d/lua/neotest-pest/init.lua#L2 The log messages do get scoped to your adapter, so it seems likely that it's intentional to me. |
Beta Was this translation helpful? Give feedback.
So far that's what I've seen other adapters doing, and it's what I do in my Pest adapter for PHP: https://github.com/V13Axel/neotest-pest/blob/b665a4881c706eea476fcaf79a21996e9b65514d/lua/neotest-pest/init.lua#L2
The log messages do get scoped to your adapter, so it seems likely that it's intentional to me.