fixed video not showing after reconnect
This commit is contained in:
37
client/src/plugins/log.ts
Normal file
37
client/src/plugins/log.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import { PluginObject } from 'vue'
|
||||
|
||||
interface Logger {
|
||||
error(error: Error): void
|
||||
warn(...log: any[]): void
|
||||
info(...log: any[]): void
|
||||
debug(...log: any[]): void
|
||||
}
|
||||
|
||||
declare global {
|
||||
const $log: Logger
|
||||
|
||||
interface Window {
|
||||
$log: Logger
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'vue/types/vue' {
|
||||
interface Vue {
|
||||
$log: Logger
|
||||
}
|
||||
}
|
||||
|
||||
const plugin: PluginObject<undefined> = {
|
||||
install(Vue) {
|
||||
window.$log = {
|
||||
error: (error: Error) => console.error('[%cNEKO%c] %cERR', 'color: #498ad8;', '', 'color: #d84949;', error),
|
||||
warn: (...log: any[]) => console.warn('[%cNEKO%c] %cWRN', 'color: #498ad8;', '', 'color: #eae364;', ...log),
|
||||
info: (...log: any[]) => console.info('[%cNEKO%c] %cINF', 'color: #498ad8;', '', 'color: #4ac94c;', ...log),
|
||||
debug: (...log: any[]) => console.log('[%cNEKO%c] %cDBG', 'color: #498ad8;', '', 'color: #eae364;', ...log),
|
||||
}
|
||||
|
||||
Vue.prototype.$log = window.$log
|
||||
},
|
||||
}
|
||||
|
||||
export default plugin
|
@ -18,10 +18,10 @@ declare module 'vue/types/vue' {
|
||||
const plugin: PluginObject<undefined> = {
|
||||
install(Vue) {
|
||||
window.$client = new NekoClient()
|
||||
.on('error', error => console.error('[%cNEKO%c] %cERR', 'color: #498ad8;', '', 'color: #d84949;', error))
|
||||
.on('warn', (...log) => console.warn('[%cNEKO%c] %cWRN', 'color: #498ad8;', '', 'color: #eae364;', ...log))
|
||||
.on('info', (...log) => console.info('[%cNEKO%c] %cINF', 'color: #498ad8;', '', 'color: #4ac94c;', ...log))
|
||||
.on('debug', (...log) => console.log('[%cNEKO%c] %cDBG', 'color: #498ad8;', '', 'color: #eae364;', ...log))
|
||||
.on('error', window.$log.error)
|
||||
.on('warn', window.$log.warn)
|
||||
.on('info', window.$log.info)
|
||||
.on('debug', window.$log.debug)
|
||||
|
||||
Vue.prototype.$client = window.$client
|
||||
},
|
||||
|
Reference in New Issue
Block a user