Skip to content

qt: Don't log to console by default#13055

Merged
maflcko merged 1 commit intobitcoin:masterfrom
laanwj:2018_04_gui_console
Apr 23, 2018
Merged

qt: Don't log to console by default#13055
maflcko merged 1 commit intobitcoin:masterfrom
laanwj:2018_04_gui_console

Conversation

@laanwj
Copy link
Member

@laanwj laanwj commented Apr 23, 2018

Default -printtoconsole to false for the GUI. GUI programs should not print to the console unnecessarily. For example, when launched by the window manager, the output might end up in the X session log file,
resulting in duplicate logging. On Windows, it is pointless as well because bitcoin-qt isn't a console application.

This same mechanism is used to set -server to true by default for bitcoind: https://github.com/bitcoin/bitcoin/blob/master/src/bitcoind.cpp#L116

(fixes #13004)

Default `-printtoconsole` to false for the GUI. GUI programs should not
print to the console unnecessarily. For example, when launched by the
window manager, the output might end up in the X session log file,
resulting in duplicate logging. On Windows, it is pointless as well
because bitcoin-qt isn't a console application.
@laanwj laanwj added the GUI label Apr 23, 2018
@jonasschnelli
Copy link
Contributor

I'm not sure if changing the printtoconsole default in #13004 was reasonable. IMO forgetting to pass-in -noprintoconsole during debugging/developing quickly leads to lost data required for debugging.

utACK aee80b0.

@laanwj
Copy link
Member Author

laanwj commented Apr 23, 2018

I'm not sure if changing the printtoconsole default in #13004 was reasonable. IMO forgetting to pass-in -noprintoconsole during debugging/developing quickly leads to lost data required for debugging.

I think it's reasonable: the default (when not -daemon) is to log to both the log file and the console. After #13004 logging to the console no longer implies not logging the file. That's only done when -nodebuglogfile is provided.

@jnewbery
Copy link
Contributor

utACK aee80b0

@maflcko maflcko merged commit aee80b0 into bitcoin:master Apr 23, 2018
maflcko pushed a commit that referenced this pull request Apr 23, 2018
aee80b0 qt: Don't log to console by default (Wladimir J. van der Laan)

Pull request description:

  Default `-printtoconsole` to false for the GUI. GUI programs should not print to the console unnecessarily. For example, when launched by the window manager, the output might end up in the X session log file,
  resulting in duplicate logging. On Windows, it is pointless as well because bitcoin-qt isn't a console application.

  This same mechanism is used to set `-server` to true by default for bitcoind: https://github.com/bitcoin/bitcoin/blob/master/src/bitcoind.cpp#L116

  (fixes #13004)

Tree-SHA512: 24ae460d9d97130a063f7bf7fa6da1e6cc46643a94ea0827aa64d0f4a80647e5e7394695b24ea0f49a147a1fa07329659d224f04511fc24b97a9869d1c29b890
@rikur
Copy link

rikur commented Jun 21, 2018

I stopped seeings logs in bitcoind configured with --no-gui after upgrading to 0.16.1. I'm wondering if this change is to "blame". I don't configure logging in my bitcoin.conf.

Running macOS.

@jnewbery
Copy link
Contributor

what is --no-gui? As far as I'm aware that's not valid config for bitcoind or the configure script.

In any case, the change in this PR does not affect bitcoind, just bitcoin-qt.

@maflcko
Copy link
Member

maflcko commented Jun 21, 2018

@rikur Please file an issue and provide all the information if you can reproduce.

jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Dec 6, 2019
Summary:
aee80b0 qt: Don't log to console by default (Wladimir J. van der Laan)

Pull request description:

  Default `-printtoconsole` to false for the GUI. GUI programs should not print to the console unnecessarily. For example, when launched by the window manager, the output might end up in the X session log file,
  resulting in duplicate logging. On Windows, it is pointless as well because bitcoin-qt isn't a console application.

  This same mechanism is used to set `-server` to true by default for bitcoind: https://github.com/bitcoin/bitcoin/blob/master/src/bitcoind.cpp#L116

  (fixes #13004)

Tree-SHA512: 24ae460d9d97130a063f7bf7fa6da1e6cc46643a94ea0827aa64d0f4a80647e5e7394695b24ea0f49a147a1fa07329659d224f04511fc24b97a9869d1c29b890

Backport of Core PR13055
bitcoin/bitcoin#13055

Depends on D4511

Test Plan:
  make check
  ./bitcoin-qt
Verify nothing is being output to the console.

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: deadalnix, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4514
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request Apr 15, 2020
9f969e9 [GUI] Don't log to console by default. (furszy)

Pull request description:

  Default `-printtoconsole` to false for the GUI.

  GUI programs should not print to the console unnecessarily. For example, when launched by the
  window manager, the output might end up in the X session log file, resulting in duplicate logging. On Windows, it is pointless as well because pivx-qt isn't a console application.

  Coming from upstream@[13055](bitcoin#13055)

ACKs for top commit:
  Fuzzbawls:
    ACK 9f969e9
  random-zebra:
    utACK 9f969e9

Tree-SHA512: 3778d7019c0ad574e48ea1c867f7bf61351920d5a8933a2d450f1b1f038cf2fffdc50dc16fc7860f4cf2c0491dba6111ea31365897c4820700b3b0ac0f536e71
jonspock pushed a commit to jonspock/devault that referenced this pull request Sep 28, 2020
Summary:
aee80b0ef9 qt: Don't log to console by default (Wladimir J. van der Laan)

Pull request description:

  Default `-printtoconsole` to false for the GUI. GUI programs should not print to the console unnecessarily. For example, when launched by the window manager, the output might end up in the X session log file,
  resulting in duplicate logging. On Windows, it is pointless as well because bitcoin-qt isn't a console application.

  This same mechanism is used to set `-server` to true by default for bitcoind: https://github.com/bitcoin/bitcoin/blob/master/src/bitcoind.cpp#L116

  (fixes #13004)

Tree-SHA512: 24ae460d9d97130a063f7bf7fa6da1e6cc46643a94ea0827aa64d0f4a80647e5e7394695b24ea0f49a147a1fa07329659d224f04511fc24b97a9869d1c29b890

Backport of Core PR13055
bitcoin/bitcoin#13055

Depends on D4511

Test Plan:
  make check
  ./bitcoin-qt
Verify nothing is being output to the console.

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: deadalnix, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4514
jonspock pushed a commit to jonspock/devault that referenced this pull request Sep 28, 2020
Summary:
aee80b0ef9 qt: Don't log to console by default (Wladimir J. van der Laan)

Pull request description:

  Default `-printtoconsole` to false for the GUI. GUI programs should not print to the console unnecessarily. For example, when launched by the window manager, the output might end up in the X session log file,
  resulting in duplicate logging. On Windows, it is pointless as well because bitcoin-qt isn't a console application.

  This same mechanism is used to set `-server` to true by default for bitcoind: https://github.com/bitcoin/bitcoin/blob/master/src/bitcoind.cpp#L116

  (fixes #13004)

Tree-SHA512: 24ae460d9d97130a063f7bf7fa6da1e6cc46643a94ea0827aa64d0f4a80647e5e7394695b24ea0f49a147a1fa07329659d224f04511fc24b97a9869d1c29b890

Backport of Core PR13055
bitcoin/bitcoin#13055

Depends on D4511

Test Plan:
  make check
  ./bitcoin-qt
Verify nothing is being output to the console.

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: deadalnix, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4514
jonspock pushed a commit to devaultcrypto/devault that referenced this pull request Sep 29, 2020
Summary:
aee80b0ef9 qt: Don't log to console by default (Wladimir J. van der Laan)

Pull request description:

  Default `-printtoconsole` to false for the GUI. GUI programs should not print to the console unnecessarily. For example, when launched by the window manager, the output might end up in the X session log file,
  resulting in duplicate logging. On Windows, it is pointless as well because bitcoin-qt isn't a console application.

  This same mechanism is used to set `-server` to true by default for bitcoind: https://github.com/bitcoin/bitcoin/blob/master/src/bitcoind.cpp#L116

  (fixes #13004)

Tree-SHA512: 24ae460d9d97130a063f7bf7fa6da1e6cc46643a94ea0827aa64d0f4a80647e5e7394695b24ea0f49a147a1fa07329659d224f04511fc24b97a9869d1c29b890

Backport of Core PR13055
bitcoin/bitcoin#13055

Depends on D4511

Test Plan:
  make check
  ./bitcoin-qt
Verify nothing is being output to the console.

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: deadalnix, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4514
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Nov 17, 2020
aee80b0 qt: Don't log to console by default (Wladimir J. van der Laan)

Pull request description:

  Default `-printtoconsole` to false for the GUI. GUI programs should not print to the console unnecessarily. For example, when launched by the window manager, the output might end up in the X session log file,
  resulting in duplicate logging. On Windows, it is pointless as well because bitcoin-qt isn't a console application.

  This same mechanism is used to set `-server` to true by default for bitcoind: https://github.com/bitcoin/bitcoin/blob/master/src/bitcoind.cpp#L116

  (fixes bitcoin#13004)

Tree-SHA512: 24ae460d9d97130a063f7bf7fa6da1e6cc46643a94ea0827aa64d0f4a80647e5e7394695b24ea0f49a147a1fa07329659d224f04511fc24b97a9869d1c29b890
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants