Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing autofix for jQuery.sap.log #522

Open
15 tasks
flovogt opened this issue Feb 7, 2025 · 1 comment
Open
15 tasks

Missing autofix for jQuery.sap.log #522

flovogt opened this issue Feb 7, 2025 · 1 comment
Labels
autofix An issue related to the autofix capabilities enhancement New feature or request

Comments

@flovogt
Copy link
Member

flovogt commented Feb 7, 2025

Missing autofix for jQuery.sap.log

jQuery.sap.log is deprecated. Therefore an autofix should be offered by UI5 linter.

Deprecated APIs:

  • jQuery.sap.log.getLogger
  • jQuery.sap.log.getLog
  • jQuery.sap.log.getLogEntries
  • jQuery.sap.log.addLogListener
  • jQuery.sap.log.removeLogListener
  • jQuery.sap.log.getLevel
  • jQuery.sap.log.Level
  • jQuery.sap.log.isLoggable
  • jQuery.sap.log.logSupportInfo
  • jQuery.sap.log.debug
  • jQuery.sap.log.error
  • jQuery.sap.log.fatal
  • jQuery.sap.log.info
  • jQuery.sap.log.trace
  • jQuery.sap.log.warning

Deprecated Usage

const myLogger = jQuery.sap.log.getLogger();

const myLog = jQuery.sap.log.getLog();
const myLog2 = jQuery.sap.log.getLogEntries();

const oLogListener = {};
oLogListener.onLogEntry: function(oLog) {
   //
};
jQuery.sap.log.addLogListener(oLogListener);
jQuery.sap.log.removeLogListener(oLogListener);

const level =  jQuery.sap.log.getLevel();
const logLevel = jQuery.sap.log.Level;
const isLoggable = jQuery.sap.log.isLoggable(logLevel.DEBUG);

jQuery.sap.log.logSupportInfo(true;
jQuery.sap.log.debug("This is a debug log message");
jQuery.sap.log.error("This is a error log message");
jQuery.sap.log.fatal("This is a fatal log message");
jQuery.sap.log.info("This is a info log message");
jQuery.sap.log.trace("This is a trace log message");
jQuery.sap.log.warning("This is a warning log message");

Recommended Usage

sap.ui.define([
    "sap/base/Log"
], (Log) => {
    ...
    const myLogger = Log.getLogger();

    const myLog = Log.getLogEntries();
    const myLog2 = Log.getLogEntries();

    const oLogListener = {};
    oLogListener.onLogEntry: function(oLog) {
        //
    };
    Log.addLogListener(oLogListener);
    Log.removeLogListener(oLogListener);

    const level = Log.getLevel();
    const logLevel = Log.Level;
    const isLoggable = Log.isLoggable(logLevel.DEBUG);

    Log.logSupportInfo(true;
    Log.debug("This is a debug log message");
    Log.error("This is a error log message");
    Log.fatal("This is a fatal log message");
    Log.info("This is a info log message");
    Log.trace("This is a trace log message");
    Log.warning("This is a warning log message");
})
@flovogt flovogt added enhancement New feature or request autofix An issue related to the autofix capabilities labels Feb 7, 2025
@flovogt
Copy link
Member Author

flovogt commented Feb 7, 2025

Will be implemented in CPOUI5FOUNDATION-990.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autofix An issue related to the autofix capabilities enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant