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

Option to disable verbosity of output #13

Closed
midenok opened this issue Jan 12, 2020 · 4 comments
Closed

Option to disable verbosity of output #13

midenok opened this issue Jan 12, 2020 · 4 comments

Comments

@midenok
Copy link

midenok commented Jan 12, 2020

F.ex. I do:

dl dbug_print_fk((FK_info *)el->share->foreign_keys->first-->(next!=?0x21052a8)->info)

and get this output:

dbug_print_fk((FK_info *)el->share->foreign_keys->first->info) = 0x2133a50 <dbug_item_print_buf> "foreign_id: fk_ch1; foreign_db: test; foreign_table: ch1; referenced_db: test; referenced_table: t1; referenced_key_name: fk_ch1; update_method: ???; delete_method: ???; foreign_fields: [0]: xid; referenced_fields: [0]: id"
dbug_print_fk((FK_info *)el->share->foreign_keys->first->(next !=? 0x21052a8)->info) = 0x2133a50 <dbug_item_print_buf> "foreign_id: fk_ch1_2; foreign_db: test; foreign_table: ch1; referenced_db: test; referenced_table: t2; referenced_key_name: fk_ch1_2; update_method: ???; delete_method: ???; foreign_fields: [0]: xid2; referenced_fields: [0]: id"
dbug_print_fk((FK_info *)el->share->foreign_keys->first-->(next !=? 0x21052a8)[[2]]->info) = 0x2133a50 <dbug_item_print_buf> "foreign_id: fk_ch1_3; foreign_db: test; foreign_table: ch1; referenced_db: test; referenced_table: t3; referenced_key_name: fk_ch1_3; update_method: ???; delete_method: ???; foreign_fields: [0]: xid; referenced_fields: [0]: id"

I'd really benefit from shorter output, like this:

0x2133a50 <dbug_item_print_buf> "foreign_id: fk_ch1; foreign_db: test; foreign_table: ch1; referenced_db: test; referenced_table: t1; referenced_key_name: fk_ch1; update_method: ???; delete_method: ???; foreign_fields: [0]: xid; referenced_fields: [0]: id"
0x2133a50 <dbug_item_print_buf> "foreign_id: fk_ch1_2; foreign_db: test; foreign_table: ch1; referenced_db: test; referenced_table: t2; referenced_key_name: fk_ch1_2; update_method: ???; delete_method: ???; foreign_fields: [0]: xid2; referenced_fields: [0]: id"
0x2133a50 <dbug_item_print_buf> "foreign_id: fk_ch1_3; foreign_db: test; foreign_table: ch1; referenced_db: test; referenced_table: t3; referenced_key_name: fk_ch1_3; update_method: ???; delete_method: ???; foreign_fields: [0]: xid; referenced_fields: [0]: id"

Is there such an option?

@vuvova
Copy link
Owner

vuvova commented Jan 12, 2020

Not at the moment, but I often wish there was.

I can add a rule that if the left and right part of the = sign are identical, only one is printed. Like, instead of

(gdb) dl 1..2
1 = 1
2 = 2

it'll be

(gdb) dl 1..2
1
2

or, perhaps,

(gdb) dl 1..2
= 1
= 2

Is that ok? Then if you just want a complex expression with nothing before the =, you simply wrap everything in {...} as documented.

@midenok
Copy link
Author

midenok commented Jan 14, 2020

I'd rather prefer some config variable:

import duel;
duel.verbose = false;

or something like that...

@vuvova
Copy link
Owner

vuvova commented Jan 14, 2020

First, duel doesn't have config variables yet.
Second, wrapping the expression in {...} allows to disable verbosity only when needed, because often one actually wants to see the expression, and only when it becomes very long or irrelevant one would disable it.
And third, config variable or not, it generally doesn't make much sense to print exactly the same value on both sides of =. So even in the verbose mode I'd rather force X = X to be always not verbose.

Should I keep the = sign like in

(gdb) dl 1..2
= 1
= 2

?
I think I'd better keep it, otherwise one cannot clearly see where a value starts (in case values are very long and wrap around in a terminal window)

@midenok
Copy link
Author

midenok commented Jan 16, 2020

Not speaking to others, but I don't need verbosity at all. I'm not expert here, but by perl analogy there should be ability to use module-wide variables. https://stackoverflow.com/questions/1977362/how-to-create-module-wide-variables-in-python

@vuvova vuvova closed this as completed in 74cc1e7 Jan 17, 2020
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