Skip to content

Commit

Permalink
fix: Replace error with warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadat-B committed Feb 17, 2023
1 parent 8bf480f commit c33cd88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions config/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ const config = {
},
};

let logger
let logger;

if (process.env.STORYBOOK_RUN) {
logger = {
child: console.log,
info: console.log,
warn: console.log,
error: console.log,
}
};
} else {
logger = PinoLogger.pino(
process.env.NODE_ENV === "development" ? config : {}
Expand Down
2 changes: 1 addition & 1 deletion pages/api/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function handler(req, res) {
try {
eventFiles = fs.readdirSync(eventsPath);
} catch (e) {
logger.info(e, `no events in ${eventsPath}`);
logger.warn(`no events in ${eventsPath}`);
return [];
}
const eventFilesContent = eventFiles.flatMap((file) => {
Expand Down

0 comments on commit c33cd88

Please sign in to comment.