This file contains hidden or 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
Introduction | |
At local development, you have access to the console. This allows you to; | |
Recreate errors. | |
Peruse stack traces. | |
Interpret cryptic error messages. | |
and debug. | |
However, at the production stage, you don’t have access to those console messages because your apps run on users’ machines (i.e. mobile, web, desktop). In this case, having some ways to record your code’s various error messages from the client and to a server, you have access to would be beneficial. There are many tools available for such use cases, typically called logging libraries, but this article won’t cover all of them. The focus of this article is on Winston library. Ready to get started? | |
Table of contents. | |
What is Logging | |
Type of data to save in your log |
This file contains hidden or 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
#!/bin/bash | |
# set -x; | |
team=$(whoami) | |
# echo $team | |
all=0 | |
if [ $# -eq 0 ] | |
then | |
echo "No arguments supplied use the -h flag for help" | |
exit 1 | |
fi |
This file contains hidden or 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
{ | |
"_id": { | |
"$oid": "5e2707d1f4e57627565aeeae" | |
}, | |
"registrationDate": { | |
"$date": "2020-01-21T14:16:49.714Z" | |
}, | |
"customerName": "Akintola", | |
"email": "[email protected]", | |
"phoneNumber": "08016789081", |
This file contains hidden or 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
#include <stdio.h> | |
#include <string.h> | |
/* entry_s is the structure declaration for storing a single key and value node*/ | |
struct entry_s { | |
char not_empty; | |
char key[7]; | |
char val[16]; | |
}; | |
/* creates a declaration keyword for the entry_s custom structure */ | |
typedef struct entry_s entry_t; |
This file contains hidden or 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
def prime_number(x): | |
if x <2: | |
return False | |
if x==2: | |
return True | |
if not x & 1: | |
return False | |
for n in range (3,int(x**0.5)+1,2): | |
if x%n == 0: | |
return False |
This file contains hidden or 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
function toCentimetre(feet) { | |
feet /= 33; | |
var centimetre = feet; | |
return centimetre; | |
} |