mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 06:20:24 +00:00
chore: changed logger export
This commit is contained in:
parent
d1b618341e
commit
75c3a82c90
@ -1,4 +1,4 @@
|
|||||||
import { Logger } from '@utils/Logger'
|
import Logger from '@utils/Logger'
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
|
|
||||||
const Advertisement = ({ size='short' }:AdvertisementProps): JSX.Element => {
|
const Advertisement = ({ size='short' }:AdvertisementProps): JSX.Element => {
|
||||||
@ -6,7 +6,8 @@ const Advertisement = ({ size='short' }:AdvertisementProps): JSX.Element => {
|
|||||||
if(process.env.NODE_ENV === 'production') {
|
if(process.env.NODE_ENV === 'production') {
|
||||||
window.adsbygoogle = window.adsbygoogle || []
|
window.adsbygoogle = window.adsbygoogle || []
|
||||||
window.adsbygoogle.push({})
|
window.adsbygoogle.push({})
|
||||||
} else Logger.debug('Ads Pushed')
|
}
|
||||||
|
Logger.debug('Ads Pushed')
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return <div className={`z-0 mx-auto w-full text-center text-white ${process.env.NODE_ENV === 'production' ? '' : 'py-12 bg-gray-700'}`} style={size === 'short' ? { height: '90px' } : { height: '330px'}}>
|
return <div className={`z-0 mx-auto w-full text-center text-white ${process.env.NODE_ENV === 'production' ? '' : 'py-12 bg-gray-700'}`} style={size === 'short' ? { height: '90px' } : { height: '330px'}}>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { SyntheticEvent, useEffect, useState } from 'react'
|
import { SyntheticEvent, useEffect, useState } from 'react'
|
||||||
import { KoreanbotsEndPoints } from '@utils/Constants'
|
import { KoreanbotsEndPoints } from '@utils/Constants'
|
||||||
import { supportsWebP } from '@utils/Tools'
|
import { supportsWebP } from '@utils/Tools'
|
||||||
import { Logger } from '@utils/Logger'
|
import Logger from '@utils/Logger'
|
||||||
|
|
||||||
const DiscordAvatar = (props: {
|
const DiscordAvatar = (props: {
|
||||||
alt?: string
|
alt?: string
|
||||||
|
|||||||
@ -3,7 +3,9 @@ import type { AppProps } from 'next/app'
|
|||||||
import dynamic from 'next/dynamic'
|
import dynamic from 'next/dynamic'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
|
|
||||||
import { init } from '@utils/Sentry'
|
import { init } from '@utils/Sentry'
|
||||||
|
import Logger from '@utils/Logger'
|
||||||
|
|
||||||
const Footer = dynamic(() => import('@components/Footer'))
|
const Footer = dynamic(() => import('@components/Footer'))
|
||||||
const Navbar = dynamic(() => import('@components/Navbar'))
|
const Navbar = dynamic(() => import('@components/Navbar'))
|
||||||
@ -18,7 +20,6 @@ import '../app.css'
|
|||||||
import '@fortawesome/fontawesome-free/css/all.css'
|
import '@fortawesome/fontawesome-free/css/all.css'
|
||||||
import '../github-markdown.css'
|
import '../github-markdown.css'
|
||||||
import { Theme } from '@types'
|
import { Theme } from '@types'
|
||||||
import { Logger } from '@utils/Logger'
|
|
||||||
|
|
||||||
init()
|
init()
|
||||||
|
|
||||||
|
|||||||
@ -1,21 +1,20 @@
|
|||||||
export class Logger {
|
const Logger = {
|
||||||
private static genStyle(bg: string, text='black') {
|
debug: function(message: string) {
|
||||||
return `color:${text};background:${bg};padding:1px 3px;border-radius:2px;margin-right:5px;`
|
print('DEBUG', message, genStyle('cyan'))
|
||||||
}
|
},
|
||||||
|
warn: function(message: string) {
|
||||||
private static print(level: string, message: string, style: string) {
|
print('WARN', message, genStyle('yellow'))
|
||||||
console.log(`%c${level}` + `%c${message}`, style, '')
|
},
|
||||||
}
|
error: function(message: string) {
|
||||||
|
print('ERROR', message, genStyle('red', 'white'))
|
||||||
static debug(message: string) {
|
|
||||||
this.print('DEBUG', message, this.genStyle('cyan'))
|
|
||||||
}
|
|
||||||
|
|
||||||
static warn(message: string) {
|
|
||||||
this.print('WARN', message, this.genStyle('yellow'))
|
|
||||||
}
|
|
||||||
|
|
||||||
static error(message: string) {
|
|
||||||
this.print('ERROR', message, this.genStyle('red', 'white'))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function genStyle(bg: string, text='black') {
|
||||||
|
return `color:${text};background:${bg};padding:1px 3px;border-radius:2px;margin-right:5px;`
|
||||||
|
}
|
||||||
|
|
||||||
|
function print(level: string, message: string, style: string) {
|
||||||
|
console.log(`%c${level}` + `%c${message}`, style, '')
|
||||||
|
}
|
||||||
|
export default Logger
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user