test(test-tooling): filter out whitespaces from container logs
See original GitHub issueDescription
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
- White space characters are filtered out from the logs
- Solution is robust in terms of not accidentally filtering out anything but the white spaces.
- Existing AIO containers can easily be migrated (preferably without changing anything at all, but we’ll see)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jgusta Yup, assigning now, thank you in advance for your contribution!
Thank you, @Leeyoungone. @petermetz is it alright if I take this?