Skip to content

Neater cloudscribe logs: allow rendering newlines to <br /> in the log view? #41

Closed
@SimonAnnetts

Description

@SimonAnnetts

It would be nice instead of seeing a log entry like this:

3/8/2023 4:06:39 PM Error ::1 cloudscribe.QueryTool.Web.QueryToolController /querytool

QueryTool: UserId:8af14603-ad31-4174-93d4-0fea2ba9ac86 Query: select * from cs_userX Command:query Npgsql.PostgresException (0x80004005): 42P01: relation "cs_userx" does not exist POSITION: 15 at Npgsql.Internal.NpgsqlConnector.g__ReadMessageLong|213_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) at cloudscribe.QueryTool.Services.QueryTool.RawQueryAsync(DbConnection connection, String query) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Services\Services\QueryTool.cs:line 38 at cloudscribe.QueryTool.Services.QueryTool.ExecuteQueryAsync(String query) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Services\Services\ExecuteQueryAsync.cs:line 16 at cloudscribe.QueryTool.Web.QueryToolController.Index(QueryToolViewModel model) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Web\Controllers\QueryToolController.cs:line 140 Exception data: Severity: ERROR SqlState: 42P01 MessageText: relation "cs_userx" does not exist Position: 15 File: parse_relation.c Line: 1373 Routine: parserOpenTable

It could be more like this:

3/8/2023 4:06:39 PM Error ::1 cloudscribe.QueryTool.Web.QueryToolController /querytool

QueryTool:
UserId: 8af14603-ad31-4174-93d4-0fea2ba9ac86
Query: select * from cs_userX
Command: query 
Npgsql.PostgresException (0x80004005): 42P01: relation "cs_userx" does not exist POSITION: 15 at Npgsql.Internal.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|213_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) at cloudscribe.QueryTool.Services.QueryTool.RawQueryAsync(DbConnection connection, String query) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Services\Services\QueryTool.cs:line 38 at cloudscribe.QueryTool.Services.QueryTool.ExecuteQueryAsync(String query) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Services\Services\ExecuteQueryAsync.cs:line 16 at cloudscribe.QueryTool.Web.QueryToolController.Index(QueryToolViewModel model) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Web\Controllers\QueryToolController.cs:line 140
Exception data: Severity: ERROR SqlState: 42P01 MessageText: relation "cs_userx" does not exist Position: 15 File: parse_relation.c Line: 1373 Routine: parserOpenTable

If we inserted (char)10 characters into a log message they could be converted in the view to <br /> tags.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions