11import type { Core } from '@strapi/strapi' ;
2+ import { createLogger } from './utils/logger' ;
23
34export default ( { strapi } : { strapi : Core . Strapi } ) => {
4- strapi . log . info ( '[Magic-Mark] Plugin bootstrapping...' ) ;
5+ const log = createLogger ( strapi ) ;
6+
7+ log . info ( 'Plugin bootstrapping...' ) ;
58
69 // Initialize License Guard
710 try {
@@ -12,16 +15,16 @@ export default ({ strapi }: { strapi: Core.Strapi }) => {
1215 const licenseStatus = await licenseGuardService . initialize ( ) ;
1316
1417 if ( ! licenseStatus . valid ) {
15- strapi . log . error ( '╔════════════════════════════════════════════════════════════════╗' ) ;
16- strapi . log . error ( '║ [ERROR] MAGICMARK PLUGIN - NO VALID LICENSE ║' ) ;
17- strapi . log . error ( '║ ║' ) ;
18- strapi . log . error ( '║ This plugin requires a valid license to operate. ║' ) ;
19- strapi . log . error ( '║ Please activate your license via Admin UI: ║' ) ;
20- strapi . log . error ( '║ Go to Settings → MagicMark → License ║' ) ;
21- strapi . log . error ( '║ ║' ) ;
22- strapi . log . error ( '║ The plugin will run with limited functionality until ║' ) ;
23- strapi . log . error ( '║ a valid license is activated. ║' ) ;
24- strapi . log . error ( '╚════════════════════════════════════════════════════════════════╝' ) ;
18+ log . error ( '╔════════════════════════════════════════════════════════════════╗' ) ;
19+ log . error ( '║ [ERROR] MAGICMARK PLUGIN - NO VALID LICENSE ║' ) ;
20+ log . error ( '║ ║' ) ;
21+ log . error ( '║ This plugin requires a valid license to operate. ║' ) ;
22+ log . error ( '║ Please activate your license via Admin UI: ║' ) ;
23+ log . error ( '║ Go to Settings → MagicMark → License ║' ) ;
24+ log . error ( '║ ║' ) ;
25+ log . error ( '║ The plugin will run with limited functionality until ║' ) ;
26+ log . error ( '║ a valid license is activated. ║' ) ;
27+ log . error ( '╚════════════════════════════════════════════════════════════════╝' ) ;
2528 } else if ( licenseStatus . valid ) {
2629 // Get license key from store if data is not available (grace period)
2730 const pluginStore = strapi . store ( {
@@ -30,27 +33,27 @@ export default ({ strapi }: { strapi: Core.Strapi }) => {
3033 } ) ;
3134 const storedKey = await pluginStore . get ( { key : 'licenseKey' } ) as string | undefined ;
3235
33- strapi . log . info ( '╔════════════════════════════════════════════════════════════════╗' ) ;
34- strapi . log . info ( '║ [SUCCESS] MAGICMARK PLUGIN LICENSE ACTIVE ║' ) ;
35- strapi . log . info ( '║ ║' ) ;
36+ log . info ( '╔════════════════════════════════════════════════════════════════╗' ) ;
37+ log . info ( '║ [SUCCESS] MAGICMARK PLUGIN LICENSE ACTIVE ║' ) ;
38+ log . info ( '║ ║' ) ;
3639
3740 if ( licenseStatus . data ) {
38- strapi . log . info ( `║ License: ${ licenseStatus . data . licenseKey } ║` ) ;
39- strapi . log . info ( `║ User: ${ licenseStatus . data . firstName } ${ licenseStatus . data . lastName } ` . padEnd ( 66 ) + '║' ) ;
40- strapi . log . info ( `║ Email: ${ licenseStatus . data . email } ` . padEnd ( 66 ) + '║' ) ;
41+ log . info ( `║ License: ${ licenseStatus . data . licenseKey } ║` ) ;
42+ log . info ( `║ User: ${ licenseStatus . data . firstName } ${ licenseStatus . data . lastName } ` . padEnd ( 66 ) + '║' ) ;
43+ log . info ( `║ Email: ${ licenseStatus . data . email } ` . padEnd ( 66 ) + '║' ) ;
4144 } else if ( storedKey ) {
42- strapi . log . info ( `║ License: ${ storedKey } (Offline Mode) ║` ) ;
43- strapi . log . info ( `║ Status: Grace Period Active ║` ) ;
45+ log . info ( `║ License: ${ storedKey } (Offline Mode) ║` ) ;
46+ log . info ( `║ Status: Grace Period Active ║` ) ;
4447 }
4548
46- strapi . log . info ( '║ ║' ) ;
47- strapi . log . info ( '║ [PING] Auto-pinging every 15 minutes ║' ) ;
48- strapi . log . info ( '╚════════════════════════════════════════════════════════════════╝' ) ;
49+ log . info ( '║ ║' ) ;
50+ log . info ( '║ [PING] Auto-pinging every 15 minutes ║' ) ;
51+ log . info ( '╚════════════════════════════════════════════════════════════════╝' ) ;
4952 }
5053 } , 3000 ) ; // Wait 3 seconds for API to be ready
5154 } catch ( error ) {
52- strapi . log . error ( '[ERROR] Error initializing License Guard:' , error ) ;
55+ log . error ( '[ERROR] Error initializing License Guard:' , error ) ;
5356 }
5457
55- strapi . log . info ( '[Magic-Mark] Plugin bootstrapped successfully' ) ;
58+ log . info ( 'Plugin bootstrapped successfully' ) ;
5659} ;
0 commit comments