Skip to content

Commit

Permalink
Merge pull request #16 from Marketionist/node-update
Browse files Browse the repository at this point in the history
Added line dividers for logs output
  • Loading branch information
Marketionist authored Apr 30, 2019
2 parents b32d9f9 + e2500ff commit ae41def
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ let nodeTestingServer = {

// Show logs if they are enabled in nodeTestingServer.config.logsEnabled
if (nodeTestingServer.config.logsEnabled >= 1) {
console.log('========');
// Print incoming request METHOD, URL
console.log(`Request: ${req.method} ${req.url}`);
}
Expand Down Expand Up @@ -55,6 +56,7 @@ let nodeTestingServer = {
if (nodeTestingServer.config.logsEnabled >= 1) {
// Print outcoming response CODE
console.log(`Response: ${res.statusCode}`);
console.log('========');
}

return;
Expand Down Expand Up @@ -105,6 +107,7 @@ let nodeTestingServer = {
if (nodeTestingServer.config.logsEnabled >= 1) {
// Print outcoming response CODE
console.log(`Response: ${res.statusCode}`);
console.log('========');
}
} else {
fs.exists(filePath, (exists) => {
Expand All @@ -130,6 +133,7 @@ let nodeTestingServer = {
if (nodeTestingServer.config.logsEnabled >= 1) {
// Print outcoming response CODE
console.log(`Response: ${res.statusCode}`);
console.log('========');
}

return;
Expand All @@ -141,6 +145,7 @@ let nodeTestingServer = {
// Print outcoming response CODE
console.log(`Response: ${res.statusCode}`);
console.log(packageName, `Served ${filePath} from the server to the client`);
console.log('========');
}
if (nodeTestingServer.config.logsEnabled === 2) {
console.timeEnd('Response time');
Expand All @@ -157,6 +162,7 @@ let nodeTestingServer = {
if (nodeTestingServer.config.logsEnabled >= 1) {
// Print outcoming response CODE
console.log(`Response: ${res.statusCode}`);
console.log('========');
}
}
}),
Expand Down

0 comments on commit ae41def

Please sign in to comment.