Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE11 truncates string in console

I have a string of maybe 20 or 30 lines i'd like to output to the console all in one console.log call. This works great in Chrome, but IE11 truncates about half of the string in the console. Any way to prevent this? The string is something like:

-----------------------------------------
Wed Jan 7 20:41:16 GMT-0700 2015 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9
-----------------------------------------
41:17:181 - Initiating recording...
41:17:233 - Creating NetStream...
41:17:240 - NetStream created.
41:17:240 - Recording ready.
-----------------------------------------
Wed Jan 7 20:41:16 GMT-0700 2015 NetConnectionQueue - rtmp://AMS2alt.commercialtribe.net/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9
-----------------------------------------
41:16:867 - Initializing...
41:16:868 - Creating negotiator...
41:17:175 - Connection success: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9
41:17:175 - Connection added to queue.
41:17:182 - Connection request recieved...
41:17:183 - Connection request fulfilled.
41:17:452 - Connection success: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9
41:17:452 - Connection added to queue.
41:18:503 - -----------------------------------------
Wed Jan 7 20:41:16 GMT-0700 2015 NetNegotiator Log
-----------------------------------------
41:16:890 - Attempting: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9
41:17:174 - Negotiator reset
41:17:194 - Attempting: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9
41:17:282 - Attempting: rtmp://AMS2alt.commercialtribe.net:443/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9
41:17:339 - Attempting: rtmp://AMS2alt.commercialtribe.net:80/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9
41:17:400 - Attempting: rtmpt://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9
41:17:451 - NetConnection attempt failed: rtmp://AMS2alt.commercialtribe.net:443/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9
41:17:452 - Negotiator reset
like image 221
Rob Allsopp Avatar asked Jan 08 '15 16:01

Rob Allsopp


1 Answers

A 1024 character limit on a single message isn't exactly unreasonable. Even if it was, IE offers no means of altering that limitation.

Out of curiosity, why is this one big block rather than individual calls to console.log() grouped with console.group()?

console.group("Wed Jan 7 20:41:16 GMT-0700 2015 530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9");
console.log("41:17:181 - Initiating recording...");
console.log("41:17:233 - Creating NetStream...");
console.log("41:17:240 - NetStream created.");
console.log("41:17:240 - Recording ready.");
console.groupEnd();
console.group("Wed Jan 7 20:41:16 GMT-0700 2015 NetConnectionQueue - rtmp://AMS2alt.commercialtribe.net/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9");
console.log("41:16:867 - Initializing...");
console.log("41:16:868 - Creating negotiator...");
console.log("41:17:175 - Connection success: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9");
console.log("41:17:175 - Connection added to queue.");
console.log("41:17:182 - Connection request recieved...");
console.log("41:17:183 - Connection request fulfilled.");
console.log("41:17:452 - Connection success: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9");
console.log("41:17:452 - Connection added to queue.");
console.groupEnd();
console.group("Wed Jan 7 20:41:16 GMT-0700 2015 NetNegotiator Log");
console.log("41:16:890 - Attempting: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9");
console.log("41:17:174 - Negotiator reset");
console.log("41:17:194 - Attempting: rtmp://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9");
console.log("41:17:282 - Attempting: rtmp://AMS2alt.commercialtribe.net:443/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9");
console.log("41:17:339 - Attempting: rtmp://AMS2alt.commercialtribe.net:80/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9");
console.log("41:17:400 - Attempting: rtmpt://AMS2alt.commercialtribe.net:1935/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9");
console.log("41:17:451 - NetConnection attempt failed: rtmp://AMS2alt.commercialtribe.net:443/recorder/530d8aa855df0c2d269a5a5853a47a049c52c9d83a2d71d9");
console.log("41:17:452 - Negotiator reset");
console.groupEnd();

sample console output showing multiple groups of logged statements

If the message is received as one big string you could certainly log it in smaller slices:

function processSlices(sliceable, sliceSize, callback) {
  var i = 0,
    n = sliceable.length;
  while (i < n) {
    callback(sliceable.slice(i, i += sliceSize));
  }
}
// small sample with chunkSize of 7
processSlices("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", 7, console.log);
<script src="https://gh-canon.github.io/stack-snippet-console/console.min.js"></script><script>console.config({maximize:true,timeStamps:false})</script><style>.as-console-wrapper{display:block;}</style>
like image 84
canon Avatar answered Sep 27 '22 18:09

canon