Skip to content
This repository

Add example for showing exception handling #148

Merged
merged 1 commit into from almost 2 years ago

2 participants

Pavan Kumar Sunkara ubun2
Deleted user
ghost commented June 19, 2012

The content you are editing has changed. Reload the page and try again.

No description provided.

Sending Request…

Attach images by dragging & dropping or selecting them. Octocat-spinner-32 Uploading your images… Unfortunately, we don't support that file type. Try again with a PNG, GIF, or JPG. Yowza, that's a big file. Try again with an image file smaller than 10MB. This browser doesn't support image attachments. We recommend updating to the latest Internet Explorer, Google Chrome, or Firefox. Something went really wrong, and we can't process that image. Try again.

Pavan Kumar Sunkara pksunkara merged commit 94c6518 into from June 19, 2012
Pavan Kumar Sunkara pksunkara closed this June 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 19, 2012
ubun2 Add example for showing exception handling 4d050a5
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 16 additions and 0 deletions. Show diff stats Hide diff stats

  1. 16  README.md
16  README.md
Source Rendered
@@ -188,6 +188,8 @@ set `exitOnError = false`
188 188
 
189 189
 When working with custom logger instances, you can pass in separate transports to the `exceptionHandlers` property or set `.handleExceptions` on any transport.
190 190
 
  191
+Example 1
  192
+
191 193
 ``` js
192 194
   var logger = new (winston.Logger)({
193 195
     transports: [
@@ -199,6 +201,20 @@ When working with custom logger instances, you can pass in separate transports t
199 201
   });
200 202
 ```
201 203
 
  204
+Example 2
  205
+
  206
+```
  207
+var logger = new winston.Logger({
  208
+  transports: [
  209
+    new winston.transports.Console({
  210
+      handleExceptions: true,
  211
+      json: true
  212
+    })
  213
+  ],
  214
+  exitOnError: false
  215
+});
  216
+```
  217
+
202 218
 The `exitOnError` option can also be a function to prevent exit on only certain types of errors:
203 219
 
204 220
 ``` js
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.