File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1515 },
1616 "dependencies" : {
1717 "@vueuse/nuxt" : " ^10.7.0" ,
18+ "consola" : " ^3.2.3" ,
1819 "yaml" : " ^2.3.4"
1920 },
2021 "devDependencies" : {
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ export default defineNitroPlugin(async () => {
1515 const difference = parseVersion ( latestPackage . version ) - parseVersion ( currentPackage . version )
1616
1717 if ( difference > 0 ) {
18- return console . log ( `⚠️ update available: ${ latestPackage . version } `)
18+ return logger . warn ( ` update available: ${ latestPackage . version } `)
1919 }
2020
21- console . log ( '✅ mafl is up-to-date')
22- } catch ( _ ) {
23- console . log ( '❌ failed to check for an update')
21+ logger . success ( ' mafl is up-to-date')
22+ } catch ( e ) {
23+ logger . error ( ' failed to check for an update', e )
2424 }
2525} )
Original file line number Diff line number Diff line change 1+ import { consola , createConsola } from 'consola'
2+ import type { ConsolaOptions } from 'consola'
3+
4+ export const logger = consola
5+
6+ export function useLogger ( tag ?: string , options : Partial < ConsolaOptions > = { } ) {
7+ return tag ? createConsola ( { ...options , fancy : true } ) . withTag ( tag ) : logger
8+ }
You can’t perform that action at this time.
0 commit comments