isNotEmptyString(logMsgToAppend) ? `. ${logMsgToAppend}` : ''
}`;
logger.warn(`${logPrefix} ${logMsg}`);
- console.warn(chalk.yellow(`${logMsg}`));
+ console.warn(`${chalk.green(logPrefix)} ${chalk.yellow(logMsg)}`);
}
};
import merge from 'just-merge';
import { Constants } from './Constants';
-import { hasOwnProp, isCFEnvironment, isNotEmptyString, isUndefined, once } from './Utils';
+import {
+ hasOwnProp,
+ isCFEnvironment,
+ isNotEmptyString,
+ isUndefined,
+ logPrefix,
+ once,
+} from './Utils';
import {
ApplicationProtocol,
type ConfigurationData,
);
}
+ private static logPrefix = (): string => {
+ return logPrefix(' Simulator configuration |');
+ };
+
private static isConfigurationSectionCached(sectionName: ConfigurationSection): boolean {
return Configuration.configurationSectionCache.has(sectionName);
}
return workerConfiguration;
}
- private static logPrefix = (): string => {
- return `${new Date().toLocaleString()} Simulator configuration |`;
- };
-
private static checkDeprecatedConfigurationKeys() {
// connection timeout
Configuration.warnDeprecatedConfigurationKey(
file: string,
fileType: FileType,
error: NodeJS.ErrnoException,
- logPrefix: string,
+ logPfx: string,
): void {
- const prefix = isNotEmptyString(logPrefix) ? `${logPrefix} ` : '';
+ const prefix = isNotEmptyString(logPfx) ? `${logPfx} ` : '';
let logMsg: string;
switch (error.code) {
case 'ENOENT':
};
export const defaultErrorHandler = (error: Error): void => {
- console.error(chalk.red('Worker errored: ', error));
+ console.error(chalk.red('Worker errored: '), error);
};