diff --git a/docs/config.rst b/docs/config.rst index 83a1008842de..38228037cee4 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -166,8 +166,8 @@ Optional settings .. describe:: maxMessageLength - By default, raven truncates messages to a max length of 100 - characters. You can customize the max length with this parameter. + By default, Raven does not truncate messages. If you need to truncate + characters for whatever reason, you may set this to limit the length. .. describe:: transport diff --git a/src/raven.js b/src/raven.js index 3151dcf95915..0bec5f0f204d 100644 --- a/src/raven.js +++ b/src/raven.js @@ -45,7 +45,7 @@ function Raven() { includePaths: [], crossOrigin: 'anonymous', collectWindowErrors: true, - maxMessageLength: 100 + maxMessageLength: 0 }; this._ignoreOnError = 0; this._isRavenInstalled = false; diff --git a/src/utils.js b/src/utils.js index 21da2fcad3cc..cc40cad82561 100644 --- a/src/utils.js +++ b/src/utils.js @@ -61,7 +61,7 @@ function objectMerge(obj1, obj2) { } function truncate(str, max) { - return str.length <= max ? str : str.substr(0, max) + '\u2026'; + return !max || str.length <= max ? str : str.substr(0, max) + '\u2026'; } /** diff --git a/test/utils.test.js b/test/utils.test.js index 961f72fc3dd9..bcaac82e3214 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -86,6 +86,7 @@ describe('utils', function () { assert.equal(truncate('lolol', 3), 'lol\u2026'); assert.equal(truncate('lolol', 10), 'lolol'); assert.equal(truncate('lol', 3), 'lol'); + assert.equal(truncate(new Array(1000).join('f'), 0), new Array(1000).join('f')); }); });