File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ monolog:
5454 error :
5555 type : stream
5656 path : " %kernel.logs_dir%/error.log"
57+ include_stacktraces : true
5758 level : error
5859 channels : [ "!event", "!deprecation" ]
5960 deprecation :
Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import JsonData from ' @/components/json/JsonData.vue' ;
3+ import Strings from ' @/services/Strings.ts' ;
34import type LogRecord from ' @/models/LogRecord' ;
45import {isEmptyJson , prettyFormatJson } from ' @/services/JsonFormatter' ;
56import {ref } from ' vue' ;
@@ -23,7 +24,10 @@ function click(value: string) {
2324 <span class =" pe-2 text-secondary" >{{ logRecord.datetime }}</span >
2425 <span class =" text-primary pe-2" v-if =" logRecord.channel.length > 0" >{{ logRecord.channel }}</span >
2526 <span :class =" ['pe-2', logRecord.level_class ]" >{{ logRecord.level_name }}</span >
26- <span >{{ logRecord.text }}</span >
27+
28+ <!-- log message -->
29+ <span v-if =" !expanded" v-text =" logRecord.text.substring(0, 500)" ></span >
30+ <span v-if =" expanded" v-html =" Strings.nl2br(Strings.escapeHtml(logRecord.text))" ></span >
2731 </div >
2832 <div class =" border-top pt-2 ps-2 mb-2 position-relative" v-bind:class =" {'d-block': expanded, 'd-none': !expanded}" v-if =" expanded" >
2933 <button class =" btn btn-outline-secondary slv-btn-raw" @click =" styled = !styled" >{{ styled ? 'raw' : 'styled' }}</button >
Original file line number Diff line number Diff line change @@ -10,4 +10,15 @@ export default class Strings {
1010
1111 return str ;
1212 }
13+
14+ public static nl2br ( str : string ) : string {
15+ return str . replace ( / \n / g, '<br/>' ) ;
16+ }
17+
18+ public static escapeHtml ( str : string ) : string {
19+ return str
20+ . replace ( / & / g, '&' )
21+ . replace ( / < / g, '<' )
22+ . replace ( / > / g, '>' )
23+ }
1324}
You can’t perform that action at this time.
0 commit comments