Skip to content

Commit 70f07ed

Browse files
committed
Merge pull request #441 from getsentry/maxlength
Disable maxMessageLength truncation by default
2 parents d02b693 + 65b3763 commit 70f07ed

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

Diff for: docs/config.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ Optional settings
166166
167167
.. describe:: maxMessageLength
168168

169-
By default, raven truncates messages to a max length of 100
170-
characters. You can customize the max length with this parameter.
169+
By default, Raven does not truncate messages. If you need to truncate
170+
characters for whatever reason, you may set this to limit the length.
171171

172172
.. describe:: transport
173173

Diff for: src/raven.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function Raven() {
4545
includePaths: [],
4646
crossOrigin: 'anonymous',
4747
collectWindowErrors: true,
48-
maxMessageLength: 100
48+
maxMessageLength: 0
4949
};
5050
this._ignoreOnError = 0;
5151
this._isRavenInstalled = false;

Diff for: src/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function objectMerge(obj1, obj2) {
6161
}
6262

6363
function truncate(str, max) {
64-
return str.length <= max ? str : str.substr(0, max) + '\u2026';
64+
return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
6565
}
6666

6767
/**

Diff for: test/utils.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ describe('utils', function () {
8686
assert.equal(truncate('lolol', 3), 'lol\u2026');
8787
assert.equal(truncate('lolol', 10), 'lolol');
8888
assert.equal(truncate('lol', 3), 'lol');
89+
assert.equal(truncate(new Array(1000).join('f'), 0), new Array(1000).join('f'));
8990
});
9091
});
9192

0 commit comments

Comments
 (0)