Why does printing a long line of text result in it wrapping across multiple lines?
#477 · closed · 6 comments
Comments
megahertz
Which transport do you mean - file, console? This library doesn't add line breaks.
RelaxPic
file and console. like this ``` 13835 [2025-09-11 18:00:16.216] [error] [ 'webContents执行' ] 13836 [2025-09-11 18:00:16.216] [error] [ 'webContents执行webContents执行' ] 13837 [2025-09-11 18:00:16.216] [error] [ 'webContents执行webContents执行webContents执行' ] 13838 [2025-09-11 18:00:16.216] [error] [ 'webContents执行webContents执行webContents执行执行webContents执行' ] 13839 [2025-09-11 18:00:16.216] [error] [ 13840 'webContents执行webContents执行webContents执行执行webContents执行执行webContents执行' 13841 ] 13842 [2025-09-11 18:00:16.216] [error] [ 13843 'webContents执行webContents执行webContents执行执行webContents执行执行webContents执行执行webContents执行' 13844 ] ```
megahertz
If you pass an array type to the logger function, it formats it. You need to serialize it before passing, or use a custom format function to prevent that.
RelaxPic
That's not an array, it's just a relatively long string. Shouldn't parentheses wrap? `]` It was wrapped up
megahertz
If you pass a string, it shouldn't print the parentheses. Maybe you use a custom formatter function, hook or transform
imbant
I did this to avoid wrapping: ```diff function Report(...data) { -- scope.info(data) ++ scope.info(...data) } ```