[KEYCLOAK-11193] Change 'disableLogging' to 'enableLogging' and default to false

This commit is contained in:
Jon Koops 2019-09-19 12:23:03 +02:00 committed by Bruno Oliveira da Silva
parent 2b1acb99a2
commit ff77b549ec
2 changed files with 7 additions and 5 deletions

View file

@ -136,10 +136,10 @@ declare namespace Keycloak {
pkceMethod?: KeycloakPkceMethod;
/**
* Disables any information from being logged to the console.
* Enables logging messages from Keycloak to the console.
* @default false
*/
disableLogging?: boolean
enableLogging?: boolean
}
interface KeycloakLoginOptions {

View file

@ -163,8 +163,10 @@
kc.pkceMethod = initOptions.pkceMethod;
}
if (typeof initOptions.disableLogging === 'boolean') {
kc.disableLogging = initOptions.disableLogging;
if (typeof initOptions.enableLogging === 'boolean') {
kc.enableLogging = initOptions.enableLogging;
} else {
kc.enableLogging = false;
}
}
@ -1683,7 +1685,7 @@
function createLogger(fn) {
return function() {
if (!kc.disableLogging) {
if (kc.enableLogging) {
fn.apply(console, Array.prototype.slice.call(arguments));
}
};