-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented debug flag to turn off debug logging
- Loading branch information
1 parent
5e2ccc5
commit c112f71
Showing
14 changed files
with
133 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
services: | ||
server: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "5001:5000" | ||
environment: | ||
- BASE_PATH= | ||
- JWT_SECRET=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.nhan23TF0qyO4l4rDMkJ8ebNLMgV62NGfBozt9huymA | ||
- TOKEN_EXPIRY=24h | ||
- ALLOW_NEW_ACCOUNTS=true | ||
- DEBUG=true | ||
volumes: | ||
- ./data:/data/snippets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const DEBUG = process.env.DEBUG === 'true'; | ||
|
||
class Logger { | ||
static debug(...args) { | ||
if (DEBUG) { | ||
console.log('[DEBUG]', ...args); | ||
} | ||
} | ||
|
||
static error(...args) { | ||
if (DEBUG) { | ||
console.error('[ERROR]', ...args); | ||
} else { | ||
const messages = args.map(arg => | ||
arg instanceof Error ? arg.message : arg | ||
); | ||
console.error('[ERROR]', ...messages); | ||
} | ||
} | ||
|
||
static info(...args) { | ||
console.log('[INFO]', ...args); | ||
} | ||
} | ||
|
||
module.exports = Logger; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.