Permalink
Browse files

Readme tidy and tweaked test script.

  • Loading branch information...
1 parent ea84297 commit d0213151680ca9e71d95260f63bf91982f33fad3 @wolfeidau committed Oct 31, 2012
Showing with 41 additions and 20 deletions.
  1. +17 −0 README.md
  2. +24 −0 crashlogtest.js
  3. +0 −20 httptest.js
View
@@ -16,6 +16,23 @@ var logger = new (winston.Logger)({
```
+## Testing
+
+I have included a small test program named httptest.js, to use it:
+
+Create a directory in your home called .crashlog then add a file containing the credentials from your crash log project.
+
+```javascript
+exports.creds = {'accessKeyId': 'XXXX', 'accessKeySecret': 'XXX'};
+```
+
+Then simply run use node to run the script.
+```shell
+node crashlogtest.js
+```
+
+
+
## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/gruntjs/grunt).
View
@@ -0,0 +1,24 @@
+/**
+ * Quick script to send a test message through to crashlog.
+ *
+ * Create a directory in your home called .crashlog then add a file containing the credentials from your crash log project.
+ *
+ * exports.creds = {'accessKeyId': 'XXXX', 'accessKeySecret': 'XXX'};
+ */
+var http = require('http'),
+ winston = require('winston'),
+ winstonCrashLog = require('./lib/winston-crashlog');
+
+var config = require( process.env['HOME'] + '/.crashlog/creds');
+
+console.log('accessKeyId: ' + config.creds.accessKeyId);
+
+var logger = new (winston.Logger)({
+ transports: [
+ new (winston.transports.Console)()
+ ]
+});
+
+winston.handleExceptions(new winston.transports.CrashLog({ accessKeyId: config.creds.accessKeyId, accessKeySecret: config.creds.accessKeySecret}));
+
+throw new Error('Hello, winston!');
View
@@ -1,20 +0,0 @@
-
-var http = require('http'),
- winston = require('winston'),
- winstonCrashLog = require('./lib/winston-crashlog');
-
-var config = require('/Users/markw/.crashlog/creds');
-
-console.log('accessKeyId: ' + config.creds.accessKeyId);
-
-var logger = new (winston.Logger)({
- transports: [
- new (winston.transports.Console)()
- ]
-});
-
-//winston.handleExceptions(new winston.transports.Http({ 'host': 'localhost', 'port': 8000, 'path': '/notify' }));
-winston.handleExceptions(new winston.transports.CrashLog({ host: 'localhost', port: 8000, accessKeyId: config.creds.accessKeyId, accessKeySecret: config.creds.accessKeySecret}));
-
-//logger.log('error', 'Hello webhook log files!', { 'foo': 'bar' });
-throw new Error('Hello, winston!');

0 comments on commit d021315

Please sign in to comment.