doc.yeswiki.pro/node_modules/@algolia/logger-console/dist/logger-console.esm.js

26 lines
698 B
JavaScript
Raw Normal View History

2023-05-20 16:37:42 +00:00
import { LogLevelEnum } from '@algolia/logger-common';
/* eslint no-console: 0 */
function createConsoleLogger(logLevel) {
return {
debug(message, args) {
if (LogLevelEnum.Debug >= logLevel) {
console.debug(message, args);
}
return Promise.resolve();
},
info(message, args) {
if (LogLevelEnum.Info >= logLevel) {
console.info(message, args);
}
return Promise.resolve();
},
error(message, args) {
console.error(message, args);
return Promise.resolve();
},
};
}
export { createConsoleLogger };