Skip to content

Commit 2a8744f

Browse files
abinavseelanmjbvz
authored andcommitted
Add logging snippets for Javascript & typescript (microsoft#37889)
1 parent 8e1bf19 commit 2a8744f

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

extensions/javascript/snippets/javascript.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,29 @@
160160
"//#endregion"
161161
],
162162
"description": "Folding Region End"
163+
},
164+
"Log to the console": {
165+
"prefix": "log",
166+
"body": [
167+
"console.log($1);",
168+
"$0"
169+
],
170+
"description": "Log to the console"
171+
},
172+
"Log warning to console": {
173+
"prefix": "warn",
174+
"body": [
175+
"console.warn($1);",
176+
"$0"
177+
],
178+
"description": "Log warning to the console"
179+
},
180+
"Log error to console": {
181+
"prefix": "error",
182+
"body": [
183+
"console.error($1);",
184+
"$0"
185+
],
186+
"description": "Log error to the console"
163187
}
164188
}

extensions/typescript/snippets/typescript.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@
7070
],
7171
"description": "Log to the console"
7272
},
73+
"Log warning to console": {
74+
"prefix": "warn",
75+
"body": [
76+
"console.warn($1);",
77+
"$0"
78+
],
79+
"description": "Log warning to the console"
80+
},
81+
"Log error to console": {
82+
"prefix": "error",
83+
"body": [
84+
"console.error($1);",
85+
"$0"
86+
],
87+
"description": "Log error to the console"
88+
},
7389
"Define a full property": {
7490
"prefix": "prop",
7591
"body": [

0 commit comments

Comments
 (0)