question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test(test-tooling): filter out whitespaces from container logs

See original GitHub issue

Description

Right now if you check the logs of the tests some AIO images produce lines like this by the hundreds at boot time, making it harder to find your way in the logs of the containers.

  [2021-08-19T22:51:08.118Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.122Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,122 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.122Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.127Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,126 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.127Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.131Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,131 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.132Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.136Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,136 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.136Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.140Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,140 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.141Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.145Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,144 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.145Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.149Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,149 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.149Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.155Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,153 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.155Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.158Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,158 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.158Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.163Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,162 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.163Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.172Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,169 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.172Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.172Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,171 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.172Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
    [2021-08-19T22:51:08.177Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] ".2021-08-19 22:51:08,177 DEBG 'dockerd' stderr output:\r\n"
    [2021-08-19T22:51:08.178Z] DEBUG (FabricTestLedgerV1): [ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-08-19--1084--add-org-x] '.\r\n'
 

Acceptance Criteria

  1. White space characters are filtered out from the logs
  2. Solution is robust in terms of not accidentally filtering out anything but the white spaces.
  3. Existing AIO containers can easily be migrated (preferably without changing anything at all, but we’ll see)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
petermetzcommented, Oct 12, 2021

@jgusta Yup, assigning now, thank you in advance for your contribution!

1reaction
jgustacommented, Oct 11, 2021

Thank you, @Leeyoungone. @petermetz is it alright if I take this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove the white space at the start of the string
Try to use javascript's trim() function, Basically it will remove the leading and trailing spaces from a string. var string=' This is test'; ......
Read more >
How to handle whitespace changes within text with
Hi, I have experienced some test failures where double white space in between text and at the end of sentences exists.
Read more >
How To Remove Spaces from a String In Python - DigitalOcean
Use the strip() method to remove the leading and trailing whitespace: s.strip(). Copy. The output is:.
Read more >
Trim Whitespace VI - NI - National Instruments
The Trim Whitespace VI does not remove double byte characters. The default is to remove white space from both ends of string.
Read more >
How do I automatically trim trailing whitespace with Notepad++?
And to remove the default Save shortcut, double click on Shortcut field and then select None from the combo box. – Mitch. Dec...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found