Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report log level to stderr #215

Open
rpdelaney opened this issue Feb 29, 2024 · 2 comments
Open

Report log level to stderr #215

rpdelaney opened this issue Feb 29, 2024 · 2 comments

Comments

@rpdelaney
Copy link

rpdelaney commented Feb 29, 2024

For example:

$ wl-paste > ~/carlsen-kaidanov-2023.pgn
Clipboard content is not available as inferred output type "application/vnd.chess-pgn"
Use "wl-paste --list-types" to view available types. Use "--type" to explicitly specify a type.
$

With this output it's not clear if the file has been created (it has) or if this error is fatal (it's not). Something like this might be better:

$ wl-paste > ~/carlsen-kaidanov-2023.pgn
Warning: 
Clipboard content is not available as inferred output type "application/vnd.chess-pgn"
Use "wl-paste --list-types" to view available types. Use "--type" to explicitly specify a type.
$
@bugaevc
Copy link
Owner

bugaevc commented Feb 29, 2024

Hi,

thanks for the suggestion, but I don't think I'm following why you'd want that:

it's not clear if the file has been created (it has)

Well, the (empty) file is created by your shell, not by wl-clipboard, before wl-paste even starts running. So the file will be created whether or not wl-clipboard does anything or runs into any errors.

if this error is fatal (it's not)

Depending on what you call fatal, I guess? It certainly means we could not paste; wl-paste exits with code 1 right after printing this error. But it's not fatal, as in nothing's crashed, your computer is not on fire, you should probably just re-run wl-paste with an explicit --type option.

In your specific case, you're trying to paste to a PGN file, so wl-clipboard looks for application/vnd.chess-pgn in the clipboard, but apparently it doesn't contain that. Since PGN is (apparently) a textual format, perhaps the source app thought it was copying plain text? Try wl-paste --type text > ~/carlsen-kaidanov-2023.pgn then.

@rpdelaney
Copy link
Author

I see. If I'm wrong in thinking this is a warning and not fatal, then can illustrate the point: users are prone to confusion about which messages are for fatal errors without being hit over the head with it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants