Skip to content

Commit

Permalink
Fixed an issue where logs couldn't be submitted in strict mode on node.
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Dec 15, 2016
1 parent 6435ba8 commit 210ef6e
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 21 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The definition of the word exceptionless is: to be without exception. Exceptionl
## Show me the code! ##

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

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

- **Bower:**
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exceptionless",
"version": "1.4.2",
"version": "1.4.3",
"description": "JavaScript client for Exceptionless",
"license": "Apache-2.0",
"main": "dist/exceptionless.js",
Expand Down
12 changes: 9 additions & 3 deletions dist/exceptionless.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/exceptionless.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/exceptionless.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/exceptionless.min.js.map

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions dist/exceptionless.node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/exceptionless.node.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions example/express/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ client.config.defaultData['SampleUser'] = {

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

app.get('/', function (req, res) {
app.get('/', function index(req, res) {
client.submitLog('loading index content');
res.send('Hello World!');
});

app.get('/about', function (req, res) {
app.get('/about', function about(req, res) {
client.submitFeatureUsage('about');
res.send('About');
});

app.get('/boom', function (req, res) {
app.get('/boom', function boom(req, res) {
throw new Error('Boom!!');
});

Expand Down
1 change: 1 addition & 0 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function sendEvents(numberToSends, eventType) {
}

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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exceptionless",
"version": "1.4.2",
"version": "1.4.3",
"description": "JavaScript client for Exceptionless",
"license": "Apache-2.0",
"main": "dist/exceptionless.node.js",
Expand Down
12 changes: 9 additions & 3 deletions src/ExceptionlessClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ export class ExceptionlessClient {
} else if (message) {
builder = builder.setSource(sourceOrMessage).setMessage(message);
} else {
// TODO: Look into using https: //www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/
let caller: any = arguments.callee.caller;
builder = builder.setSource(caller && caller.name).setMessage(sourceOrMessage);
builder = builder.setMessage(sourceOrMessage);

try {
// TODO: Look into using https: //www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/
let caller: any = this.createLog.caller;
builder = builder.setSource(caller && caller.caller && caller.caller.name);
} catch (e) {
this.config.log.trace('Unable to resolve log source: ' + e.message);
}
}

return builder;
Expand Down

0 comments on commit 210ef6e

Please sign in to comment.