HomePhabricator

[Chronik] Add \n to logs in error.rs

Description

[Chronik] Add \n to logs in error.rs

Summary:
These look messy in debug.log when they occur because of the missing \n at the end.

For example, test plan on master would result in [chronik/chronik-http/src/error.rs:39] [<chronik unknown>] helloChronik HTTP server got an unknown error: helloReceived a POST request for
(cringe).

Now the log looks like this (based):

2023-04-03T13:40:31.058558Z (mocktime: 2012-04-02T02:22:17Z) [chronik/chronik-http/src/error.rs:39] [<chronik unknown>] hello
2023-04-03T13:40:31.058609Z (mocktime: 2012-04-02T02:22:17Z) [chronik/chronik-http/src/error.rs:40] [<chronik unknown>] Chronik HTTP server got an unknown error: hello
2023-04-03T13:40:31.116991Z (mocktime: 2012-04-02T02:22:17Z) [src/httpserver.cpp:252] [http_request_cb] Received a POST request for / from 127.0.0.1:62544

Test Plan:

  1. Add abc_rust_error::bail!("hello") as first line in QueryTxs::tx_by_id
  2. ninja
  3. run chronik_tx functional test (-> fails)
  4. logs log multiple lines now

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D13541

Details

Provenance
tobias_ruckAuthored on Apr 3 2023, 17:02
tobias_ruckPushed on Apr 4 2023, 09:28
Reviewer
Restricted Project
Differential Revision
D13541: [Chronik] Add \n to logs in error.rs
Parents
rABC0f2b8d3a58c5: Remove shift-base:net-processing from ubsan suppressions
Branches
Unknown
Tags
Unknown