console-ninja icon indicating copy to clipboard operation
console-ninja copied to clipboard

[Feature]: Show logs when using SAPUI5’s Log class (not just console.log)

Open gltched-usr opened this issue 4 months ago • 6 comments

Describe the feature you'd like.

Right now:

  • Console Ninja works with console.log() when running console-ninja, but it doesn’t pick up logs from SAPUI5’s recommended Log class
  • Console Ninja requires running console-ninja to 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.

gltched-usr avatar Aug 13 '25 08:08 gltched-usr

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:

Image

ArtemGovorov avatar Aug 14 '25 04:08 ArtemGovorov

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?

gltched-usr avatar Aug 15 '25 07:08 gltched-usr

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.

smcenlly avatar Aug 15 '25 23:08 smcenlly

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)?

gltched-usr avatar Aug 18 '25 08:08 gltched-usr

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.

smcenlly avatar Aug 18 '25 21:08 smcenlly

+1 Would be interested in support for SAPUI5 aswell

TheDanniCraft avatar Aug 25 '25 14:08 TheDanniCraft