Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Commit 297b3e6

Browse files
committed
Provide getReport API to return the contents of node-report.
Merge in the changes from node-report 2.0
1 parent 645308a commit 297b3e6

27 files changed

+185
-173
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
# Package files
4141
NodeReport*.txt
42+
node-report*.txt
4243
npm-debug.log
4344
nodereport-*.tgz
4445
nodereport_test.log

CHANGES.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2017-02-09, Version 2.0.0
2+
=========================
3+
4+
* mac: Fix compilation errors (Howard Hellyer)
5+
6+
* Rename nodereport module to node-report (Richard Chamberlain)
7+
8+
* Fix source directory for install target (Richard Lau)
9+
10+
* aix: skip command line check for test-fatal-error (Richard Lau)
11+
12+
* Add the list of library files loaded by the process to nodereport. (Howard Hellyer)
13+
14+
* docs: AIX supports triggering on USR2 signal (Richard Lau)
15+
16+
* Fix behaviour on exception to match node default (Richard Chamberlain)
17+
18+
* Adds the command line used to start the node process to nodereport. (Howard Hellyer)
19+
20+
* Opt-in hooks and signal by default (Richard Chamberlain)
21+
22+
* Fix for clang warning: libstdc++ is deprecated (Richard Chamberlain)
23+
24+
125
2016-12-12, Version 1.0.7
226
=========================
327

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to nodereport
1+
# Contributing to node-report
22

33
## Code of Conduct
44

@@ -8,7 +8,7 @@ The [Node.js Code of Conduct][] applies to this repo.
88

99
## Code Contributions
1010

11-
The nodereport project falls under the governance of the post-mortem
11+
The node-report project falls under the governance of the post-mortem
1212
working group which is documented in:
1313
https://github.com/nodejs/post-mortem/blob/master/GOVERNANCE.md
1414

GOVERNANCE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# nodereport Project Governance
1+
# node-report Project Governance
22

3-
The nodereport project falls under the governance of the post-mortem
3+
The node-report project falls under the governance of the post-mortem
44
working group which is documented in:
55
https://github.com/nodejs/post-mortem/blob/master/GOVERNANCE.md.

LICENCE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
The MIT License (MIT)
22
=====================
33

4-
Copyright (c) 2016 nodereport contributors
4+
Copyright (c) 2016 node-report contributors
55
--------------------------------------------------
66

7-
*nodereport contributors listed at <https://github.com/nodejs/nodereport/blob/master/AUTHORS>*
7+
*nodereport contributors listed in <https://github.com/nodejs/nodereport/blob/master/package.json>*
88

99
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1010

MAINTAINER.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Instructions for maintainers of the nodereport project
2-
3-
## Publishing to the npm registry
4-
5-
The nodereport project is published as an npm native module
6-
7-
For each publish to npm:
8-
9-
- update the version property in the package.json file, incrementing the major, minor and patch level as appropriate
10-
- update the CHANGES.md file with a list of commits since last release
11-
- commit CHANGES.md and package.json to nodereport master branch
12-
- tag commit with an annotated tag
13-
- git checkout and npm publish the nodereport package
14-
15-
Suggested tooling is the slt-release script documented here: https://github.com/strongloop/strong-tools
1+
# Instructions for maintainers of the node-report project
2+
3+
## Publishing to the npm registry
4+
5+
The node-report project is published as an npm native module
6+
7+
For each publish to npm:
8+
9+
- update the version property in the package.json file, incrementing the major, minor and patch level as appropriate
10+
- update the CHANGES.md file with a list of commits since last release
11+
- commit CHANGES.md and package.json to node-report master branch
12+
- tag commit with an annotated tag
13+
- git checkout and npm publish the node-report package
14+
15+
Suggested tooling is the slt-release script documented here: https://github.com/strongloop/strong-tools

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# nodereport
1+
# node-report
22

33
Delivers a human-readable diagnostic summary, written to file.
44

@@ -14,18 +14,18 @@ Supports Node.js v4, v6 and v7 on Linux, MacOS, Windows and AIX.
1414
## Usage
1515

1616
```bash
17-
npm install nodereport
18-
node -r nodereport app.js
17+
npm install node-report
18+
node -r node-report app.js
1919
```
20-
A NodeReport will be triggered automatically on unhandled exceptions and fatal
20+
A report will be triggered automatically on unhandled exceptions and fatal
2121
error events (for example out of memory errors), and can also be triggered
2222
by sending a USR2 signal to a Node.js process (AIX/Linux/MacOS only).
2323

24-
A NodeReport can also be triggered via an API call from a JavaScript
24+
A report can also be triggered via an API call from a JavaScript
2525
application.
2626

2727
```js
28-
var nodereport = require('nodereport');
28+
var nodereport = require('node-report');
2929
nodereport.triggerReport();
3030
```
3131
The content of a NodeReport can also be returned as a JavaScript string via an
@@ -40,27 +40,27 @@ The API can be used without adding the automatic exception and fatal error
4040
hooks and the signal handler, as follows:
4141

4242
```js
43-
var nodereport = require('nodereport/api');
43+
var nodereport = require('node-report/api');
4444
nodereport.triggerReport();
4545
```
4646

47-
Content of the NodeReport consists of a header section containing the event
47+
Content of the report consists of a header section containing the event
4848
type, date, time, PID and Node version, sections containing JavaScript and
4949
native stack traces, a section containing V8 heap information, a section
5050
containing libuv handle information and an OS platform information section
51-
showing CPU and memory usage and system limits. An example NodeReport can be
51+
showing CPU and memory usage and system limits. An example report can be
5252
triggered using the Node.js REPL:
5353

5454
```
5555
$ node
56-
> nodereport = require('nodereport')
56+
> nodereport = require('node-report')
5757
> nodereport.triggerReport()
58-
Writing Node.js report to file: NodeReport.20161020.091102.8480.001.txt
58+
Writing Node.js report to file: node-report.20161020.091102.8480.001.txt
5959
Node.js report completed
6060
>
6161
```
6262

63-
When a NodeReport is triggered, start and end messages are issued to stderr
63+
When a report is triggered, start and end messages are issued to stderr
6464
and the filename of the report is returned to the caller. The default filename
6565
includes the date, time, PID and a sequence number. Alternatively, a filename
6666
can be specified as a parameter on the `triggerReport()` call.
@@ -74,14 +74,15 @@ nodereport.triggerReport("myReportName");
7474
Additional configuration is available using the following APIs:
7575

7676
```js
77+
var nodereport = require('node-report/api');
7778
nodereport.setEvents("exception+fatalerror+signal+apicall");
7879
nodereport.setSignal("SIGUSR2|SIGQUIT");
7980
nodereport.setFileName("stdout|stderr|<filename>");
8081
nodereport.setDirectory("<full path>");
8182
nodereport.setVerbose("yes|no");
8283
```
8384

84-
Configuration on module Initialization is also available via environment variables:
85+
Configuration on module initialization is also available via environment variables:
8586

8687
```bash
8788
export NODEREPORT_EVENTS=exception+fatalerror+signal+apicall
@@ -93,14 +94,14 @@ export NODEREPORT_VERBOSE=yes|no
9394

9495
## Examples
9596

96-
To see examples of NodeReports generated from these events you can run the
97-
demonstration applications provided in the nodereport github repository. These are
97+
To see examples of reports generated from these events you can run the
98+
demonstration applications provided in the node-report github repository. These are
9899
Node.js applications which will prompt you to trigger the required event.
99100

100-
1. `api.js` - NodeReport triggered by JavaScript API call.
101-
2. `exception.js` - NodeReport triggered by unhandled exception.
102-
3. `fatalerror.js` - NodeReport triggered by fatal error on JavaScript heap out of memory.
103-
4. `loop.js` - looping application, NodeReport triggered using kill `-USR2 <pid>`.
101+
1. `api.js` - report triggered by JavaScript API call.
102+
2. `exception.js` - report triggered by unhandled exception.
103+
3. `fatalerror.js` - report triggered by fatal error on JavaScript heap out of memory.
104+
4. `loop.js` - looping application, report triggered using kill `-USR2 <pid>`.
104105

105106
## License
106107

binding.gyp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
"libraries": [ "dbghelp.lib", "Netapi32.lib", "PsApi.lib" ],
1414
"dll_files": [ "dbghelp.dll", "Netapi32.dll", "PsApi.dll" ],
1515
}],
16-
["OS=='mac'", {
17-
"xcode_settings": {
18-
'CLANG_CXX_LIBRARY': 'libc++',
19-
'CLANG_CXX_LANGUAGE_STANDARD':'c++11',
20-
}
21-
}],
2216
],
2317
"defines": [
2418
'NODEREPORT_VERSION="<!(node -p \"require(\'./package.json\').version\")"'

demo/api_call.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Example - generation of NodeReport via API call
2-
var nodereport = require('nodereport');
1+
// Example - generation of report via API call
2+
var nodereport = require('node-report');
33
var http = require("http");
44

55
var count = 0;
@@ -8,12 +8,12 @@ function my_listener(request, response) {
88
switch(count++) {
99
case 0:
1010
response.writeHead(200,{"Content-Type": "text/plain"});
11-
response.write("\nRunning NodeReport API demo... refresh page to trigger NodeReport");
11+
response.write("\nRunning node-report API demo... refresh page to trigger report");
1212
response.end();
1313
break;
1414
case 1:
1515
response.writeHead(200,{"Content-Type": "text/plain"});
16-
// Call the nodereport module to trigger a NodeReport
16+
// Call the node-report module to trigger a report
1717
var filename = nodereport.triggerReport();
1818
response.write("\n" + filename + " written - refresh page to close");
1919
response.end();

demo/exception.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Example - generation of NodeReport on uncaught exception
2-
require('nodereport').setEvents("exception");
1+
// Example - generation of report on uncaught exception
2+
require('node-report').setEvents("exception");
33
var http = require("http");
44

55
var count = 0;
@@ -8,7 +8,7 @@ function my_listener(request, response) {
88
switch(count++) {
99
case 0:
1010
response.writeHead(200,{"Content-Type": "text/plain"});
11-
response.write("\nRunning NodeReport exception demo... refresh page to cause exception (application will terminate)");
11+
response.write("\nRunning node-report exception demo... refresh page to cause exception (application will terminate)");
1212
response.end();
1313
break;
1414
default:

0 commit comments

Comments
 (0)