Skip to content

Commit 210ef6e

Browse files
committed
Fixed an issue where logs couldn't be submitted in strict mode on node.
1 parent 6435ba8 commit 210ef6e

12 files changed

+41
-21
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The definition of the word exceptionless is: to be without exception. Exceptionl
1010
## Show me the code! ##
1111

1212
```html
13-
<script src="https://cdn.rawgit.com/exceptionless/Exceptionless.JavaScript/v1.4.2/dist/exceptionless.min.js"></script>
13+
<script src="https://cdn.rawgit.com/exceptionless/Exceptionless.JavaScript/v1.4.3/dist/exceptionless.min.js"></script>
1414
<script>
1515
var client = exceptionless.ExceptionlessClient.default;
1616
client.config.apiKey = 'API_KEY_HERE';
@@ -49,7 +49,7 @@ Use one of the following methods to install Exceptionless.js into your browser a
4949
Add the following script to your page:
5050

5151
```html
52-
<script src="https://cdn.rawgit.com/exceptionless/Exceptionless.JavaScript/v1.4.2/dist/exceptionless.min.js"></script>
52+
<script src="https://cdn.rawgit.com/exceptionless/Exceptionless.JavaScript/v1.4.3/dist/exceptionless.min.js"></script>
5353
```
5454

5555
- **Bower:**

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "exceptionless",
3-
"version": "1.4.2",
3+
"version": "1.4.3",
44
"description": "JavaScript client for Exceptionless",
55
"license": "Apache-2.0",
66
"main": "dist/exceptionless.js",

dist/exceptionless.js

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.node.js

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.node.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/express/app.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,17 @@ client.config.defaultData['SampleUser'] = {
2323

2424
client.config.defaultTags.push('Example', 'Node');
2525

26-
app.get('/', function (req, res) {
26+
app.get('/', function index(req, res) {
27+
client.submitLog('loading index content');
2728
res.send('Hello World!');
2829
});
2930

30-
app.get('/about', function (req, res) {
31+
app.get('/about', function about(req, res) {
3132
client.submitFeatureUsage('about');
3233
res.send('About');
3334
});
3435

35-
app.get('/boom', function (req, res) {
36+
app.get('/boom', function boom(req, res) {
3637
throw new Error('Boom!!');
3738
});
3839

example/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function sendEvents(numberToSends, eventType) {
3434
}
3535

3636
function getRandomInt(min, max) {
37+
exceptionless.ExceptionlessClient.default.submitLog('getting random int min:' + min + ' max:' + max);
3738
return Math.floor(Math.random() * (max - min + 1)) + min;
3839
}
3940

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "exceptionless",
3-
"version": "1.4.2",
3+
"version": "1.4.3",
44
"description": "JavaScript client for Exceptionless",
55
"license": "Apache-2.0",
66
"main": "dist/exceptionless.node.js",

src/ExceptionlessClient.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,15 @@ export class ExceptionlessClient {
7878
} else if (message) {
7979
builder = builder.setSource(sourceOrMessage).setMessage(message);
8080
} else {
81-
// TODO: Look into using https: //www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/
82-
let caller: any = arguments.callee.caller;
83-
builder = builder.setSource(caller && caller.name).setMessage(sourceOrMessage);
81+
builder = builder.setMessage(sourceOrMessage);
82+
83+
try {
84+
// TODO: Look into using https: //www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/
85+
let caller: any = this.createLog.caller;
86+
builder = builder.setSource(caller && caller.caller && caller.caller.name);
87+
} catch (e) {
88+
this.config.log.trace('Unable to resolve log source: ' + e.message);
89+
}
8490
}
8591

8692
return builder;

0 commit comments

Comments
 (0)