Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

[DEVOPS-1109] cli argument to inhibit console log: --log-console-off #3785

Merged
merged 3 commits into from
Oct 25, 2018

Conversation

CodiePP
Copy link
Contributor

@CodiePP CodiePP commented Oct 24, 2018

Signed-off-by: Alexander Diemand codieplusplus@apax.net

Description

flag to turn off logging to the console.

PR for Daedalus: input-output-hk/daedalus#1144
(adds the flag --log-console-off to the installer which writes it to the launcher-config.yaml)

Linked issue

DEVOPS-1109

Type of change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🛠 New feature (non-breaking change which adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
  • [~] 🔨 New or improved tests for existing code
  • [~] ⛑ git-flow chore (backport, hotfix, etc)

Developer checklist

  • I have read the style guide document, and my code follows the code style of this project.
  • If my code deals with exceptions, it follows the guidelines.
  • I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on cardanodocs.com, amending the inline Haddock comments, any relevant README file or one of the document listed in the docs directory.
  • CHANGELOG entry has been added and is linked to the correct PR on GitHub.

Testing checklist

  • [~] I have added tests to cover my changes.
  • [~] All new and existing tests passed.

QA Steps

start a node with --log-console-off and verify that no message is printed on the console.

@CodiePP
Copy link
Contributor Author

CodiePP commented Oct 24, 2018

verified this with the "block sync" test:

exec ${NODE} \
  --update-with-package \
  --rebuild-db \
  --no-client-auth \
  --wallet-address "127.0.0.1:8090" \
  --db-path "${BASEP}/db" \
  --configuration-key "mainnet_wallet_macos64" \
  --logs-prefix "${BASEP}/logs" \
  --log-config "${BASEP}/conf/log-config-prod.yaml" \
  --log-console-off \
  --tlsca "${BASEP}/conf/tls/ca/ca.crt" \
  --tlscert "${BASEP}/conf/tls/server/server.crt" \
  --tlskey "${BASEP}/conf/tls/server/server.key" \
  --keyfile "${BASEP}/secrets/secret.key" \
  --wallet-db-path "${BASEP}/wallet" \
  --configuration-file "${BASEP}/conf/configuration.yaml" \
  --topology "${BASEP}/conf/wallet-topology.yaml" \

no more log messages to the console!

@365andreas
Copy link
Contributor

365andreas commented Oct 24, 2018

Also verified that no message were logged in console for demo-with-new-wallet-api.sh,
using the following diff:

--- a/scripts/common-functions.sh
+++ b/scripts/common-functions.sh
@@ -270,7 +270,7 @@ function node_cmd {
   #echo -n " --statsd-server $statsd_server"
   echo -n " --node-id node$i"
   echo -n " --topology $topology_file"
-  #echo -n " --kademlia $kademlia_file"
+  echo -n " --log-console-off"
   # Use the policies option if you want to change enqueue/dequeue/failure
   # policies without re-compiling. See example files
   #   scripts/policies/policy_core.yaml

Only logging of launcher is shown which is limited.

@CodiePP
Copy link
Contributor Author

CodiePP commented Oct 24, 2018

verified Daedalus on Linux:

[user@nixos:~/.local/share/Daedalus/mainnet]$ ls -l Logs/
insgesamt 48368
-rw-r--r-- 1 user users       0 24. Okt 15:01 cardano-node.log
lrwxrwxrwx 1 user users      19 24. Okt 15:11 node -> node-20181024131143
-rw-r--r-- 1 user users 5278783 23. Okt 15:52 node-20181023134452
-rw-r--r-- 1 user users 5278948 23. Okt 15:55 node-20181023135253
-rw-r--r-- 1 user users 5282850 23. Okt 15:58 node-20181023135548
-rw-r--r-- 1 user users 5288088 23. Okt 16:03 node-20181023135859
-rw-r--r-- 1 user users 5289868 23. Okt 16:10 node-20181023140301
-rw-r--r-- 1 user users 5266819 24. Okt 15:03 node-20181023141021
-rw-r--r-- 1 user users 5278378 24. Okt 15:06 node-20181024130308
-rw-r--r-- 1 user users 5278314 24. Okt 15:09 node-20181024130606
-rw-r--r-- 1 user users 5275647 24. Okt 15:11 node-20181024130900
-rw-r--r-- 1 user users 1992350 24. Okt 15:12 node-20181024131143
drwxr-xr-x 1 user users     662 24. Okt 15:10 pub

the flag is added by the installer to the launcher-config.yaml and the node, started by Daedalus, is happily syncing blocks and not logging on the console anymore.

@KtorZ
Copy link
Contributor

KtorZ commented Oct 25, 2018

Since this is needed for 1.4 I am happy to merge that considering that work will be done in order to:

  • Remove this addition
  • Fix logging parsers and setup to have it reflects more transparently the given configuration

See https://iohk.myjetbrains.com/youtrack/issue/CBR-473

Copy link
Contributor

@KtorZ KtorZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cf comment.

CodiePP and others added 3 commits October 25, 2018 12:42
Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
@CodiePP CodiePP force-pushed the adiemand/DEVOPS-1109/inhibit-console-log branch from 109e9ce to 51f1cb2 Compare October 25, 2018 10:43
@CodiePP
Copy link
Contributor Author

CodiePP commented Oct 25, 2018

rebased on develop to rerun CI

@CodiePP CodiePP merged commit 8d3384c into develop Oct 25, 2018
@CodiePP CodiePP deleted the adiemand/DEVOPS-1109/inhibit-console-log branch October 25, 2018 11:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants