Skip to content

Commit

Permalink
Exported the instance of logger and provided the path of contentstack…
Browse files Browse the repository at this point in the history
… folder
  • Loading branch information
cs-raj committed Sep 20, 2023
1 parent ca9ef20 commit a177859
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/contentstack-utilities/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { LoggerService } from './logger';
export { default as logger } from './logger';
export { default as cliux } from './cli-ux';
export { default as CLIError } from './cli-error';
export { default as messageHandler } from './message-handler';
Expand Down
7 changes: 4 additions & 3 deletions packages/contentstack-utilities/src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import winston from 'winston';
import messageHandler from './message-handler';

export class LoggerService {
class LoggerService {
name: string;
data: object | null;
logger: winston.Logger;
Expand All @@ -17,7 +16,7 @@ export class LoggerService {
transports: [
// new winston.transports.Console(),
new winston.transports.File({
filename: `./logs/${name}.log`,
filename: `../contentstack/logs/${name}.log`,
}),
],
format: winston.format.combine(
Expand Down Expand Up @@ -97,3 +96,5 @@ export class LoggerService {
}
}
}

export default new LoggerService('cli')

0 comments on commit a177859

Please sign in to comment.