Comments (5)
Hi, this is the ui5-typescript repository and the issue report template says:
** IMPORTANT **
This tracker is for issues caused by the tools maintained here (type definition generator and ts-interface generator for control development support).
But if the bug is within the original OpenUI5/SAPUI5 code/JSDoc, then please report the issue there!
Right now I don't see how this report would be about the type definition generators of UI5. Do I miss anything?
If it is about setting the logging level in UI5, then the OpenUI5 repository would be the place to report. Additional information would then be helpful, like how exactly you have tried to set the log level and what UI5 version you are using and whether it is a standalone app or there's something around like FLP, which could also affect logging.
But anyway, a page with the following setting doesn't give me any logging:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<title>OpenUI5 Logging App</title>
<script id="sap-ui-bootstrap" src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_fiori_3" data-sap-ui-libs="sap.m" data-sap-ui-compatVersion="edge">
</script>
<script>
sap.ui.require(["sap/base/Log"], (Log) => {
Log.setLevel(Log.Level.ERROR);
// create a simple button
var oButton = new sap.m.Button({
text: "Hello World",
press: function () {
// log a message when the button is pressed
console.log("Hello world button was pressed");
}
}).placeAt("content");
})
</script>
</head>
<body class="sapUiBody" id="content">
</body>
</html>
But changing the log level to TRACE gives a couple of lines of logging on startup. Please check whether this also works for you before opening that other ticket.
from ui5-typescript.
First, thanks for the help!
I forgot to mention that this is a problem that only occurred to me in TS projects, when I generate a JS project through the yeoman generator it has the normal log level and I believe I can change the level there, but I haven't tested it.
This is the script tag I'm currently using:
<script id="sap-ui-bootstrap" src="resources/sap-ui-core.js" data-sap-ui-resourceroots='{ "bti_framework": "./" }' data-sap-ui-theme="sap_horizon" data-sap-ui-oninit="module:sap/ui/core/ComponentSupport" data-sap-ui-async="true" data-sap-ui-compatVersion="edge" data-sap-ui-frameOptions="trusted" data-sap-ui-xx-waitForTheme="true" data-sap-ui-xx-supportedLanguages="en,de"></script>
I tested the script tag you sent and with just a few changes it worked, no more console logs. I dug a little deeper and noticed that what caused the logs to come out was the fact that your tag had the src at "https://openui5.hana.ondemand.com/resources/sap-ui-core.js" while mine has "resources/sap-ui-core.js", I believe the log problem is in that library. Unfortunately I can't just migrate to the CDN as I prefer the theme of the old version of sap horizon.
I added the log level change right below the script tag and it worked in parts, it's already better than before.
To look for a complete solution for this would I open an issue in the repository that is linked to npm in this case?
And again thanks for the help
from ui5-typescript.
Ah! Loading UI5 from "resources/sap-ui-core.js" means the UI5 tooling is providing it. I'm not exactly sure about the log-related mechanisms there, but anyway: when I check in the debugger who sets the log level debug, then it happens here:
https://github.com/SAP/openui5/blob/master/src/sap.ui.core/src/sap/ui/core/_ConfigurationProvider.js#L169
Adding data-sap-ui-logLevel="ERROR"
to the bootstrap script should solve the issue.
from ui5-typescript.
Oh, and the difference is because you are running more or less against the debug sources of UI5 when using "resources/..." and against the optimized sources when using the CDN.
once you have done a UI5 build, you should also locally get the optimized ones (but now we are getting too far away from the TypeScript stuff supposedly discussed here. ;-)).
from ui5-typescript.
It worked!
Thanks a lot for the help, I finally have just the errors in the console.
from ui5-typescript.
Related Issues (20)
- QUnit not recognized when using @sapui5/ts-types[-esm] HOT 7
- Missing working solution for event.getParameter("value") HOT 3
- Missing documentation for event type names in SDK HOT 5
- Type issue with `1.115` upgrade HOT 6
- RouteInfo arguments type HOT 6
- Documentation / Feature request: How to use controller extensions in TS? HOT 8
- Issue with SelectionController taking sId as mSettings HOT 1
- How to create a typed view in SAP UI5 typescript HOT 1
- Missing type definition for `sap.m.table.ColumnWidthController` HOT 4
- Wrong source type for generated type ODataModel$DataReceivedEvent HOT 1
- [ts-interface-generator] Provide a way to annotate control properties with a TS type (which might be narrower than the UI5 one)
- [ts-interface-generator] Check what happens when overridden setters and getters narrow down the type of a property
- @deprecated tag in TS Definitions should be on the last position HOT 2
- [ts-interface-generator] Interface for ManagedObject based Class Instances
- [ts-interface-generator] Generate fully qualified module names in interface for seamless use with tsc declarations
- Productive use vs. undefined support status. HOT 3
- @sapui5/types 1.121.1, 1.121.2(?) and 1.122.1: 'JQuery' only refers to a type, but is used as namespace here. HOT 1
- Regression in @sapui5/types of 1.122.1 with tsconfig for wdi5 HOT 5
- Possible issue: too many classes are abstract? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ui5-typescript.