mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 03:57:09 +03:00
22 lines
615 B
TypeScript
22 lines
615 B
TypeScript
if (typeof (window) !== "undefined") {
|
|
window["SBLogs"] = {
|
|
debug: [],
|
|
warn: []
|
|
};
|
|
}
|
|
|
|
export function logDebug(message: string) {
|
|
if (typeof (window) !== "undefined") {
|
|
window["SBLogs"].debug.push(`[${new Date().toISOString()}] ${message}`);
|
|
} else {
|
|
console.log(`[${new Date().toISOString()}] ${message}`)
|
|
}
|
|
}
|
|
|
|
export function logWarn(message: string) {
|
|
if (typeof (window) !== "undefined") {
|
|
window["SBLogs"].warn.push(`[${new Date().toISOString()}] ${message}`);
|
|
} else {
|
|
console.warn(`[${new Date().toISOString()}] ${message}`)
|
|
}
|
|
} |