diff --git a/code/core/src/bin/core.ts b/code/core/src/bin/core.ts index ae0d841dc771..ee757dfd7356 100644 --- a/code/core/src/bin/core.ts +++ b/code/core/src/bin/core.ts @@ -28,7 +28,7 @@ addToGlobalContext('cliVersion', version); const handleCommandFailure = async (logFilePath: string | boolean): Promise => { const logFile = await logTracker.writeToFile(logFilePath); - logger.log(`Storybook debug logs can be found at: ${logFile}`); + logger.log(`Debug logs are written to: ${logFile}`); logger.outro('Storybook exited with an error'); process.exit(1); }; @@ -67,7 +67,7 @@ const command = (name: string) => .hook('postAction', async (command) => { if (logTracker.shouldWriteLogsToFile) { const logFile = await logTracker.writeToFile(command.getOptionValue('logfile')); - logger.outro(`Storybook debug logs can be found at: ${logFile}`); + logger.outro(`Debug logs are written to: ${logFile}`); } }); diff --git a/code/core/src/node-logger/logger/log-tracker.ts b/code/core/src/node-logger/logger/log-tracker.ts index 457625db7f3c..ca261b08b132 100644 --- a/code/core/src/node-logger/logger/log-tracker.ts +++ b/code/core/src/node-logger/logger/log-tracker.ts @@ -1,7 +1,5 @@ import { promises as fs } from 'node:fs'; -import path, { join } from 'node:path'; - -import { isCI } from 'storybook/internal/common'; +import { join } from 'node:path'; import type { LogLevel } from './logger'; @@ -90,7 +88,7 @@ class LogTracker { await fs.writeFile(logFilePath, logContent, 'utf-8'); this.#logs = []; - return isCI() ? logFilePath : path.relative(process.cwd(), logFilePath); + return logFilePath; } } diff --git a/code/lib/cli-storybook/src/bin/run.ts b/code/lib/cli-storybook/src/bin/run.ts index 89abf3e55411..b41966710057 100644 --- a/code/lib/cli-storybook/src/bin/run.ts +++ b/code/lib/cli-storybook/src/bin/run.ts @@ -37,7 +37,7 @@ const handleCommandFailure = } const logFile = await logTracker.writeToFile(logFilePath); - logger.log(`Storybook debug logs can be found at: ${logFile}`); + logger.log(`Debug logs are written to: ${logFile}`); logger.outro(''); process.exit(1); }; @@ -80,7 +80,7 @@ const command = (name: string) => .hook('postAction', async ({ getOptionValue }) => { if (logTracker.shouldWriteLogsToFile) { const logFile = await logTracker.writeToFile(getOptionValue('logfile')); - logger.log(`Storybook debug logs can be found at: ${logFile}`); + logger.log(`Debug logs are written to: ${logFile}`); logger.outro(CLI_COLORS.success('Done!')); } }); diff --git a/code/lib/create-storybook/src/commands/FinalizationCommand.ts b/code/lib/create-storybook/src/commands/FinalizationCommand.ts index b7fe8efe9b1c..7d3f3aac832c 100644 --- a/code/lib/create-storybook/src/commands/FinalizationCommand.ts +++ b/code/lib/create-storybook/src/commands/FinalizationCommand.ts @@ -63,11 +63,13 @@ export class FinalizationCommand { } private async printFailureMessage(storybookCommand?: string | null): Promise { - logger.warn('Storybook setup completed, but some non-blocking errors occurred.'); + logger.warn( + 'Storybook setup completed, but some non-blocking errors occurred. Please check the log file below for details.' + ); this.printNextSteps(storybookCommand); const logFile = await logTracker.writeToFile(this.logfile); - logger.warn(`Storybook debug logs can be found at: ${logFile}`); + logger.warn(`Debug logs are written to: ${logFile}`); } /** Print success message with feature summary */ diff --git a/code/lib/create-storybook/src/initiate.ts b/code/lib/create-storybook/src/initiate.ts index 368c7e738ae7..6bbc5b1145f0 100644 --- a/code/lib/create-storybook/src/initiate.ts +++ b/code/lib/create-storybook/src/initiate.ts @@ -123,7 +123,7 @@ export async function doInitiate(options: CommandOptions): Promise< const handleCommandFailure = async (logFilePath: string | boolean | undefined): Promise => { const logFile = await logTracker.writeToFile(logFilePath); logger.error('Storybook encountered an error during initialization'); - logger.log(`Storybook debug logs can be found at: ${logFile}`); + logger.log(`Debug logs are written to: ${logFile}`); logger.outro('Storybook exited with an error'); process.exit(1); };