Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import { filter, includes } from 'lodash';
import { ExportConfig } from '../types';

const setupConfig = async (exportCmdFlags: any): Promise<ExportConfig> => {
// Set progress supported module FIRST, before any log calls
// This ensures the logger respects the showConsoleLogs setting correctly
configHandler.set('log.progressSupportedModule', 'export');

let config = merge({}, defaultConfig);

// Track authentication method
Expand Down Expand Up @@ -132,8 +136,6 @@ const setupConfig = async (exportCmdFlags: any): Promise<ExportConfig> => {
throw new Error(`Invalid query format: ${error.message}`);
}
}
// Set progress supported module to check and display console logs
configHandler.set('log.progressSupportedModule', 'export');
// Add authentication details to config for context tracking
config.authenticationMethod = authenticationMethod;
log.debug('Export configuration setup completed.', { ...config });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import login from './login-handler';
import { ImportConfig } from '../types';

const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
// Set progress supported module FIRST, before any log calls
// This ensures the logger respects the showConsoleLogs setting correctly
configHandler.set('log.progressSupportedModule', 'import-setup');

let config: ImportConfig = merge({}, defaultConfig);
// setup the config
// if (importCmdFlags['config']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import login from './login-handler';
import { ImportConfig } from '../types';

const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
// Set progress supported module FIRST, before any log calls
// This ensures the logger respects the showConsoleLogs setting correctly
configHandler.set('log.progressSupportedModule', 'import');

let config: ImportConfig = merge({}, defaultConfig);
// Track authentication method
let authenticationMethod = 'unknown';
Expand Down Expand Up @@ -135,9 +139,6 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
config['exclude-global-modules'] = importCmdFlags['exclude-global-modules'];
}

// Set progress supported module to check and display console logs
configHandler.set('log.progressSupportedModule', 'import');

// Add authentication details to config for context tracking
config.authenticationMethod = authenticationMethod;
log.debug('Import configuration setup completed.', { ...config });
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-utilities/src/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export default class Logger {
const hasProgressSupport = currentModule && PROGRESS_SUPPORTED_MODULES.includes(currentModule);

if (hasProgressSupport) {
// Plugin has progress bars - respect user's showConsoleLogs setting
showConsoleLogs = logConfig.showConsoleLogs ?? true;
// Plugin has progress bars - respect user's explicit setting, or default to false (show progress bars)
showConsoleLogs = logConfig.showConsoleLogs ?? false;
} else {
// Plugin doesn't have progress support - always show console logs
showConsoleLogs = true;
Expand Down
Loading