new logging

This commit is contained in:
Adam Matthiesen 2024-03-05 01:16:10 -08:00
parent bc3ec6d653
commit b1d7a044cf
1 changed files with 15 additions and 27 deletions

View File

@ -44,19 +44,18 @@ export default defineIntegration({
// Configure Loggers
const GhostLogger = logger.fork(c.bold(c.blue("👻 Astro-GhostCMS")));
const loggerTagged = (message: string) => {
return logger.fork(`${c.bold(c.blue("👻 Astro-GhostCMS"))}${c.gray("/")}${c.blue(message)}`)
}
// Configure ENV Logger
const GhostENVLogger = logger.fork(
`${c.bold(c.blue("👻 Astro-GhostCMS"))}${c.gray("/")}${c.blue(
"ENV Check",
)}`,
);
const GhostENVLogger = loggerTagged("ENV Check");
// Configure Integration Loggers & verbose logging
const GhostIntegrationLogger = logger.fork(
`${c.bold(c.blue("👻 Astro-GhostCMS"))}${c.gray("/")}${c.blue(
"Integrations",
)}`,
);
const GhostIntegrationLogger = loggerTagged("Integrations");
// Configure Route Logger & verbose logging
const GhostRouteLogger = loggerTagged("Router");
// Log Info Helper
const intLogInfo = (message:string) => {
@ -65,13 +64,6 @@ export default defineIntegration({
}
};
// Configure Route Logger & verbose logging
const GhostRouteLogger = logger.fork(
`${c.bold(c.blue("👻 Astro-GhostCMS"))}${c.gray("/")}${c.blue(
"Router",
)}`,
);
// Log Route Info Helper
const routeLogInfo = (message:string) => {
if (verbose) {
@ -241,17 +233,13 @@ export default defineIntegration({
);
},
"astro:server:start": async ({ logger }) => {
const loggerTagged = (message: string) => {
return logger.fork(`${c.bold(c.blue("👻 Astro-GhostCMS"))}${c.gray("/")}${c.green(message)}`)
}
// Configure Loggers
const GhostLogger = logger.fork(
`${c.bold(c.blue("👻 Astro-GhostCMS"))}${c.gray("/")}${c.bold(
c.green("DEV"),
)}`,
);
const GhostUpdateLogger = logger.fork(
`${c.bold(c.blue("👻 Astro-GhostCMS"))}${c.gray("/")}${c.bold(
c.green("VERSION CHECK"),
)}`,
);
const GhostLogger = loggerTagged("DEV");
const GhostUpdateLogger = loggerTagged("VERSION CHECK");
// Start the DEV server
GhostLogger.info(