forked from Demon/demoncord
parent
2d063a8457
commit
9d51c98be8
File diff suppressed because one or more lines are too long
@ -0,0 +1,19 @@
|
||||
//@flow
|
||||
//TODO: make setting to save logs in idb, for debugging and troubleshooting purposes
|
||||
//bg: #aa8dd8
|
||||
//fg: #553986
|
||||
function log(message: string, type: string, ...locs: string[]): void {
|
||||
let string = "%cDemoncord%c "
|
||||
let style = []
|
||||
for (let i = 0; i < locs.length; i++) {
|
||||
const loc = locs[i]
|
||||
style.push("@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@700&display=swap'); font-family: 'IBM Plex Mono', monospace; font-weight: 600; background-color: #aa8dd8; color: #1d1131; border-radius: 5px; padding: 0px 5px 1px 5px; font-size: 0.9em;", "")
|
||||
string += `%c${loc}%c `
|
||||
}
|
||||
style.push("@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@700&display=swap'); font-family: 'IBM Plex Mono', monospace; font-weight: 600; background-color: #aa8dd8; color: #1d1131; border-radius: 5px; padding: 0px 5px 1px 5px; font-size: 0.9em;", "")
|
||||
string += `%c${message}`
|
||||
style.push("@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@700&display=swap'); font-family: 'IBM Plex Mono', monospace; font-weight: 500; font-size: 0.9em; color: #E2EECE;")
|
||||
console[type](string, ...style)
|
||||
}
|
||||
|
||||
export default log;
|
Loading…
Reference in new issue