mozilla-frontend-infra / react-lazylog

INACTIVE
https://mozilla-frontend-infra.github.io/react-lazylog/
Mozilla Public License 2.0
304 stars 101 forks source link

Displaying stacktraces / multiline log lines #66

Closed tomscholz closed 2 months ago

tomscholz commented 4 years ago

Hello there 👋, first of all thanks for creating and maintaining this library. It rocks!

I do have a problem/question though: The logfiles im passing to react-lazylog, often do have stack-traces and therefore line breaks in them. Is there a way to parse \n as a line break and automatically adjust the line height of the LogLine? If not, would the team be interested in such a feature?

Example line from one of the logfiles I'm working with: [Wed Jun 12 13:50:33.219398 2019] [proxy_fcgi:error] [pid 7566:tid 139658060338944] [client 192.168.1.114:47268] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function switch_to_blog() in /var/www/example.org/release/20190612-132939/website/wp-content/mu-plugins/wp-tools.php:67\nStack trace:\n#0 /var/www/example.org/release/20190612-132939/website/wp-content/plugins/casino/shortcodes/header/header.php(77): wp_tools::get_operator_list('casino')\n#1 /var/www/example.org/release/20190612-132939/website/wp-includes/class-wp-hook.php(286): casino_header_vc('')\n#2 /var/www/example.org/release/20190612-132939/website/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)\n#3 /var/www/example.org/release/20190612-132939/website/wp-includes/plugin.php(453): WP_Hook->do_action(Array)\n#4 /var/www/example.org/release/20190612-132939/website/wp-content/plugins/js_composer/js_composer.php(245): do_action('vc_before_init')\n#5 /var/www/example.org/release/20190612-132939/website/wp-includes/class-wp-hook.php(286): Vc_Manager->init('')\n#6 /var/www/example.org/rele...\n', referer: https://www.example.org/registrieren/

Cheers, Tom

helfi92 commented 4 years ago

The logfiles im passing to react-lazylog, often do have stack-traces and therefore line breaks in them. Is there a way to parse \n as a line break and automatically adjust the line height of the LogLine? If not, would the team be interested in such a feature?

You could use the text prop to pre-process the input then feed it to the log. Hope that helps.