1

I developed a Fiori application with SAPUI5 inside of the WEBIde. When I open console of the browser I see some log inside of the console that are generated automatically with SAPUI5.

enter image description here

How can I prevent SAPUI5 from generating unwanted logs?

MJBZA
  • 4,796
  • 8
  • 48
  • 97

2 Answers2

1

This was identified as a bug (OpenUI5 issue #2692) which got fixed with the release of UI5 version 1.72.0. The only UI5 produced log left from the console is "Device API logging initialized" from the sap/ui/Devicesrc which cannot be controlled by sap/base/Log yet.

Since we cannot use the logging from jquery.sap.global.js, we need to come up with a separate solution for the device API.

Other issue messages are from the browser, one of which can be resolved by removing sync XHRs from the application.

Since UI5 1.72 and with asynchronous loading, the console is much cleaner now:

UI5 console log since 1.72.0
From: https://run.plnkr.co/plunks/16J1TFICxbqETCzaxuZ0/?sap-ui-xx-componentPreload=off

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
0

You could try jQuery.sap.log.setLevel in your Component initialization. Valid parameter values include:

However, I'm not sure if any of the messages in your screen shot get generated prior to the component being initialized.

Edit: If your app isn't launched from Fiori Launchpad, you could try setting the log level in your bootstrap code - i.e. in sap.ui.getCore().attachInit().

Peter Roehlen
  • 128
  • 1
  • 8
  • I tested your solution in both places. but unfortunately none of the work. Actually the outputs come before `compunent.js` initialization and even before `sap.ui.getCore().attachInit()` – MJBZA Nov 03 '16 at 12:29
  • @MahdiJaberzadeh Ok, sorry then I'd expect it might not be possible and I'm out of ideas unfortunately. – Peter Roehlen Nov 04 '16 at 04:35