forked from highlightjs/highlight.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.js
44 lines (36 loc) · 835 Bytes
/
logger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
For the reasoning behind this please see:
https://github.com/highlightjs/highlight.js/issues/2880#issuecomment-747275419
*/
/**
* @type {Record<string, boolean>}
*/
const seenDeprecations = {};
/**
* @param {string} message
*/
export const error = (message) => {
console.error(message);
};
/**
* @param {string} message
* @param {any} args
*/
export const warn = (message, ...args) => {
console.log(`WARN: ${message}`, ...args);
};
/**
* @param {string} message
*/
export const notice = (message) => {
console.log(message);
};
/**
* @param {string} version
* @param {string} message
*/
export const deprecated = (version, message) => {
if (seenDeprecations[`${version}/${message}`]) return;
console.log(`Deprecated as of ${version}. ${message}`);
seenDeprecations[`${version}/${message}`] = true;
};