chromelogger icon indicating copy to clipboard operation
chromelogger copied to clipboard

Line number stripped from "Backtrace message" (Firefox 43)

Open skunkbad opened this issue 8 years ago • 3 comments

Backtrace message #1 is what you would expect to see in the Firefox 43 console, but the line number is stripped off:

<?php

// This displays "/path/to/example_url.php :"
$backtrace_message1 = '/path/to/example_url.php : 777';

// This displays "/path/to/example_url.php : 777 :" 
$backtrace_message2 = '/path/to/example_url.php : 777 : 0';

// This displays "(unknown)"
$backtrace_message3 = '/path/to/example_url.php : 777 :';

// This displays "(unknown)"
$backtrace_message4 = '/path/to/example_url.php : 777 : 77 :';

// This displays "/path/to/example_url.php : 777 : 77 :"
$backtrace_message5 = '/path/to/example_url.php : 777 : 77 : 7';

// This displays "/path/to/example_url.php : 7777 : 777 : 77 :"
$backtrace_message6 = '/path/to/example_url.php : 7777 : 777 : 77 : 7';

header( 'X-ChromeLogger-Data: ' . base64_encode( utf8_encode( json_encode( [
	'version' => '0.0.1',
	'columns' => [
		'log', 
		'backtrace', 
		'type'
	],
	'request_uri' => 'example_url.php',
	'rows' => [
		[
			['epoch: ' . time()],
			$backtrace_message1,
			''
		],
		[
			['epoch: ' . time()],
			$backtrace_message2,
			''
		],
		[
			['epoch: ' . time()],
			$backtrace_message3,
			''
		],
		[
			['epoch: ' . time()],
			$backtrace_message4,
			''
		],
		[
			['epoch: ' . time()],
			$backtrace_message5,
			''
		],
		[
			['epoch: ' . time()],
			$backtrace_message6,
			''
		]
	]
] ) ) ) );

skunkbad avatar Jan 28 '17 23:01 skunkbad

Hi @skunkbad does this work in Chrome?

ccampbell avatar Apr 03 '17 01:04 ccampbell

Actually, it looks like Firefox fixed the issue since I reported this. Chrome on the other hand does not work the same, because the line numbers all seem to come from log.js, which is totally useless.

skunkbad avatar Apr 03 '17 04:04 skunkbad

What exactly do you mean? When I test in Chrome with line numbers turned on I see this:

5ymi

That looks correct to me I think?

ccampbell avatar Apr 03 '17 04:04 ccampbell