mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
619 restructure local storage (#628)
* To MMKV migration working * POC migrated font size settings * Moved settings to mmkv * Fix typos * Migrated contexts slice * Migrated app slice * POC instance emoji update * Migrated drafts * Migrated simple instance properties * All migrated! * Re-structure files * Tolerant of undefined settings * Can properly logging in and out including empty state
This commit is contained in:
37
src/utils/startup/log.ts
Normal file
37
src/utils/startup/log.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import chalk from 'chalk'
|
||||
|
||||
const ctx = new chalk.Instance({ level: 3 })
|
||||
|
||||
const log = (type: 'log' | 'warn' | 'error', func: string, message: string) => {
|
||||
switch (type) {
|
||||
case 'log':
|
||||
console.log(
|
||||
ctx.bgBlue.white.bold(' Start up ') +
|
||||
' ' +
|
||||
ctx.bgBlueBright.black(` ${func} `) +
|
||||
' ' +
|
||||
message
|
||||
)
|
||||
break
|
||||
case 'warn':
|
||||
console.warn(
|
||||
ctx.bgYellow.white.bold(' Start up ') +
|
||||
' ' +
|
||||
ctx.bgYellowBright.black(` ${func} `) +
|
||||
' ' +
|
||||
message
|
||||
)
|
||||
break
|
||||
case 'error':
|
||||
console.error(
|
||||
ctx.bgRed.white.bold(' Start up ') +
|
||||
' ' +
|
||||
ctx.bgRedBright.black(` ${func} `) +
|
||||
' ' +
|
||||
message
|
||||
)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
export default log
|
Reference in New Issue
Block a user