Skip to content

Commit

Permalink
feat: add optional debug logging
Browse files Browse the repository at this point in the history
Adds an optional debug logging feature that can be enabled by setting the DEBUG environment variable.

This allows developers to more easily debug issues related to the Notion API client.
  • Loading branch information
luandro committed Sep 6, 2024
1 parent e520998 commit 594e90f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/notionClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import dotenv from 'dotenv';

// Load environment variables from .env file
dotenv.config();
console.log('Environment variables:', process.env);
if (process.env.DEBUG) {
console.log('Environment variables:', process.env);
}

if (!process.env.NOTION_API_KEY) {
throw new Error("NOTION_API_KEY is not defined in the environment variables.");
Expand Down

0 comments on commit 594e90f

Please sign in to comment.