[Feature]: Show logs when using SAPUI5’s Log class (not just console.log)
Describe the feature you'd like.
Right now:
- Console Ninja works with
console.log()when runningconsole-ninja, but it doesn’t pick up logs from SAPUI5’s recommendedLogclass - Console Ninja requires running
console-ninjato start, whereas in frameworks like Next.js it runs automatically.
Feature requests:
- Add support for capturing output from SAPUI5’s Log class.
- Provide auto-start support so Console Ninja runs without needing the explicit console-ninja command.
Hi, it may be possible to use console-ninja with SAPUI5 apps via console-ninja command.
We have tried cloning the https://github.com/UI5/sample-app.git sample repo, and running console-ninja npm run start. Ninja seems to be working as expected:
I tried it myself and console-ninja and I don't get it to work with console.log(). SAPs eslint rules also recommend using the Log. class for logging (like Log.info()).
And you think at some point console-ninja will be able to automatically work with sapui5?
Does it work for you when you use the same https://github.com/UI5/sample-app.git sample repo?
If it's not working for you, please check that Console Ninja isn't paused for your project.
If you're still having problems, please share your Console Ninja ~/.console-ninja/trace.log file from your home directory.
It's working, I just asumed it would show the logs inside the console like in nextjs. When I manually open the output tab it works. The only problem: It just works for console.log(). However SAP recommends not to use console.log(), instead use the Log class and when outputs from the Log class don't appear (But show in the browser console). Is there any chance this will be supported in the future?
And will it at some point work without the console-ninja command (like in nextjs it runs automatically)?
Thanks for confirming, and glad to hear you got it working with console.log().
At the moment, Console Ninja doesn’t automatically hook into SAPUI5’s Log class, and we don’t have immediate plans to add support for it. Similarly, SAPUI5 integration currently requires running the console-ninja command, and we don’t have near-term plans to change that.
We’ll keep this issue open to track interest from the community and if we see more demand, we’ll re-evaluate adding support in the future.
+1 Would be interested in support for SAPUI5 aswell