planetarium / 9c-launcher

Nine Chronicles Launcher
GNU General Public License v3.0
44 stars 34 forks source link

Unnecessary new lines in `main.log` #1082

Closed greymistcube closed 1 year ago

greymistcube commented 2 years ago

Example:

[2021-11-30 15:38:53.891] [info]  [15:38:53 DBG] [NetMQTransport] A request c6d5be4b-0b1b-4200-9a2c-b49960074819 sent to 0xEDf1e4ac11D17DA4504909fCd74AE202eB575F8a.Unspecified/3.138.153.104:62377.101.108.133.197: Libplanet.Net.Messages.GetChainStatus.
[15:38:53 DBG] [NetMQTransport] A request a6a5c85a-cfb8-460a-bcca-a1045229cbdc sent to 0xF5eE1085c5E78Dfe252bcF35cCcB8942dD39fa43.Unspecified/3.139.1.11:58950.27.210.211.55: Libplanet.Net.Messages.GetChainStatus.
[15:38:53 DBG] [NetMQTransport] A request a3fc512f-c027-4344-aef6-192ff9dcbd09 sent to 0x961A7453E9d9B4fCa96B5f9f0F969320A9E3A2ED.Unspecified/3.138.153.104:63955.124.104.193.136: Libplanet.Net.Messages.GetChainStatus.
[15:38:53 DBG] [NetMQTransport] A request 9d09164b-515d-4121-815a-9870a7616f7a sent to 0xdf38bFCF259639F935D6C33eeF7e3C90b5A21aBe.Unspecified/3.139.1.11:58779.42.236.130.93: Libplanet.Net.Messages.GetChainStatus.
[15:38:53 DBG] [NetMQTransport] A request 426296d4-09fa-4c87-a5cc-f43a23a32855 sent to 0x9d9E89B2CB8EA71579413dDEEc9c73C6480e1857.Unspecified/3.139.88.164:63778.1.232.111.239: Libplanet.Net.Messages.GetChainStatus.
[15:38:53 DBG] [NetMQTransport] Received 0 reply messages to 6dd1c48c-4d00-4934-8fa6-19b70d4c7cd7 from the 0x970D90bfDD5a334Ebe6EE0292f740364099087b7.Unspecified/3.130.105.235:51528.218.209.218.142: [].
[15:38:53 INF] Failed to get 0 transactions to stage.

[2021-11-30 15:38:53.892] [info]  [15:38:53 DBG] [NetMQTransport] A reply to the request 147b056e-1435-4e25-a152-55e357dd73eb has parsed: Libplanet.Net.Messages.Tx from 0x7b247c4A6606c8569f862Cd2a655bea04DeD9935.Unspecified/3.141.106.204:54385.158.222.232.177.

[2021-11-30 15:38:53.892] [info]  [15:38:53 DBG] [NetMQTransport] Received 1 reply messages to 147b056e-1435-4e25-a152-55e357dd73eb from the 0x7b247c4A6606c8569f862Cd2a655bea04DeD9935.Unspecified/3.141.106.204:54385.158.222.232.177: [{"Payload": "64313A5337313A3045022100819305ECC3B5C392726350268847E19AFBE113F997062AEF400CE44F4BBC7432022044C29F565B0A6525B1B52FB16346BA7DBE6FD15B7E45E90F8249EFAB080E5B4B313A616C6475373A747970655F69647531363A6861636B5F616E645F736C617368313075363A76616C756573647531333A6176617461724164647265737332303AF460BF4D7F97CDD75E164187BA3B27EB49C76D3075383A636F7374756D65736C657531303A65717569706D656E74736C31363AA39F8C13BC2C274F980AAEFE375B665E31363A030FCB3250253A42934EA4A96794B1B431363AD9513C90547FDE4783FEADBF33C76B8C31363AC08E88942BD98746A0F8C857FE364D6F31363A3B31D9C37A6E1E4CAE58E66ED8827F5731363AA30EC3E0F8DC944C83CA3A0B93BA06806575353A666F6F64736C6575323A696431363AA0CBCBC9689D0140B24F8D410121139475393A706C6179436F756E7475323A31327531373A72616E6B696E674D61704164647265737332303A3CC74154FE26F51B1F34A5D80DC62A79C4C32F3075373A7374616765496475323A393875373A776F726C64496475313A32656565313A6733323A4582250D0DA33B06779A8475D283D5DD210C683B9B999D74D03FAC4F58FA6BCE313A6E693630393465313A7036353A04ECCB45F8C8B4893CC5CD2F479D0BA78EB61090B66A5F235B89D9677170DE1E85CE0667A9EA4C1107A2D80A98CAEDE03B33BC436AA872F19B8BA89CE3755BA001313A7332303A667DF6AD060AE570DCE51D9BF017B4AA02FDFC5F313A747532373A323032312D31312D33305430363A33383A34362E3934393933365A313A756C32303A698CEA5DF2128BD14A5FB13896EDF0301A39D9E432303A667DF6AD060AE570DCE51D9BF017B4AA02FDFC5F32303AB0BE319DCD932713A99EF14307DA3E73144E1B9A32303AF460BF4D7F97CDD75E164187BA3B27EB49C76D3032303A3CC74154FE26F51B1F34A5D80DC62A79C4C32F3032303A4B153212B162C91A37484A4DE41FB5D22A4AED856565", "Type": "Tx", "DataFrames": ["64313A5337313A3045022100819305ECC3B5C392726350268847E19AFBE113F997062AEF400CE44F4BBC7432022044C29F565B0A6525B1B52FB16346BA7DBE6FD15B7E45E90F8249EFAB080E5B4B313A616C6475373A747970655F69647531363A6861636B5F616E645F736C617368313075363A76616C756573647531333A6176617461724164647265737332303AF460BF4D7F97CDD75E164187BA3B27EB49C76D3075383A636F7374756D65736C657531303A65717569706D656E74736C31363AA39F8C13BC2C274F980AAEFE375B665E31363A030FCB3250253A42934EA4A96794B1B431363AD9513C90547FDE4783FEADBF33C76B8C31363AC08E88942BD98746A0F8C857FE364D6F31363A3B31D9C37A6E1E4CAE58E66ED8827F5731363AA30EC3E0F8DC944C83CA3A0B93BA06806575353A666F6F64736C6575323A696431363AA0CBCBC9689D0140B24F8D410121139475393A706C6179436F756E7475323A31327531373A72616E6B696E674D61704164647265737332303A3CC74154FE26F51B1F34A5D80DC62A79C4C32F3075373A7374616765496475323A393875373A776F726C64496475313A32656565313A6733323A4582250D0DA33B06779A8475D283D5DD210C683B9B999D74D03FAC4F58FA6BCE313A6E693630393465313A7036353A04ECCB45F8C8B4893CC5CD2F479D0BA78EB61090B66A5F235B89D9677170DE1E85CE0667A9EA4C1107A2D80A98CAEDE03B33BC436AA872F19B8BA89CE3755BA001313A7332303A667DF6AD060AE570DCE51D9BF017B4AA02FDFC5F313A747532373A323032312D31312D33305430363A33383A34362E3934393933365A313A756C32303A698CEA5DF2128BD14A5FB13896EDF0301A39D9E432303A667DF6AD060AE570DCE51D9BF017B4AA02FDFC5F32303AB0BE319DCD932713A99EF14307DA3E73144E1B9A32303AF460BF4D7F97CDD75E164187BA3B27EB49C76D3032303A3CC74154FE26F51B1F34A5D80DC62A79C4C32F3032303A4B153212B162C91A37484A4DE41FB5D22A4AED856565"], "Identity": null, "Version": "100088 (Bencodex.Types.Dictionary {\n  \"macOSBinaryUrl\": \"https://download.nine-chronicles.com/v100088/macOS.tar.gz\",\n  \"timestamp\": \"2021-11-25T15:39:39+00:00\",\n  \"WindowsBinaryUrl\": \"https://download.nine-chronicles.com/v100088/Windows.zip\",\n})", "Remote": "0x7b247c4A6606c8569f862Cd2a655bea04DeD9935.Unspecified/3.141.106.204:54385.158.222.232.177", "Timestamp": "2021-11-30T06:38:54.6414646+00:00", "$type": "Tx"}].

[2021-11-30 15:38:53.893] [info]  [15:38:53 DBG] [NetMQTransport] A message has parsed: Libplanet.Net.Messages.TxIds, from 0x0d2B529983DB2fccE5dba950d2E59ecA452597A7.Unspecified/3.130.105.235:60056.118.116.108.0
[15:38:53 DBG] [NetMQTransport] Received peer is boundpeer? True
[15:38:53 DBG] [Swarm] Received a TxIds message with 1 txIds.

[2021-11-30 15:38:53.893] [info]  [15:38:53 DBG] No unaware transactions to receive.
[15:38:53 DBG] [RoutingTable] Adding peer 0x0d2B529983DB2fccE5dba950d2E59ecA452597A7.Unspecified/3.130.105.235:60056.118.116.108.0 to the routing table...

[2021-11-30 15:38:53.894] [info]  [15:38:53 DBG] 1 txs staged successfully.
[15:38:53 DBG] [Swarm] Broadcast 1 txs...

For whatever reason, redirected captured console output from headless to main.log seems to sporadically add additional empty lines. I suspect this is possibly due to Serilog batch flushing logs.

BasixKOR commented 2 years ago

If Serilog appends a line break after its logging I'm guessing it could be caused by console.log appending a line break again.

greymistcube commented 2 years ago

https://stackoverflow.com/questions/9627646/chrome-javascript-developer-console-is-it-possible-to-call-console-log-withou/32049995

Little search shows console.log() always adds a new line.

console.log(msg) is equivalent to process.stdout.write(msg + '\n').

I have no knowledge on javascript tho. Would this be hard to fix? 😶

BasixKOR commented 2 years ago

Yeah, but since we depend on electron-log for logging I think it would be tricky. Could we make the Headless emit its own log in the same folder?

greymistcube commented 2 years ago

Headless does not know about the log folder, so it should be passed as an argument if we want a separate headless log file in the same folder. If we were to do so, then main.log, the launcher log, does not encompass internal headless behavior, which may or may not be problematic depending on how we want to troubleshoot things.

Akamig commented 1 year ago

Another headless issue, closing.