File tree 3 files changed +13
-4
lines changed
3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 15
15
},
16
16
"dependencies" : {
17
17
"@vueuse/nuxt" : " ^10.7.0" ,
18
+ "consola" : " ^3.2.3" ,
18
19
"yaml" : " ^2.3.4"
19
20
},
20
21
"devDependencies" : {
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ export default defineNitroPlugin(async () => {
15
15
const difference = parseVersion ( latestPackage . version ) - parseVersion ( currentPackage . version )
16
16
17
17
if ( difference > 0 ) {
18
- return console . log ( `⚠️ update available: ${ latestPackage . version } `)
18
+ return logger . warn ( ` update available: ${ latestPackage . version } `)
19
19
}
20
20
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 )
24
24
}
25
25
} )
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