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

Add option to disable color output #791

Closed
rfalke opened this issue Jul 1, 2020 · 3 comments
Closed

Add option to disable color output #791

rfalke opened this issue Jul 1, 2020 · 3 comments

Comments

@rfalke
Copy link

rfalke commented Jul 1, 2020

Either a command line option or an option in the JSON config file or when output doesn't go to a tty (like a file).

@xkubov
Copy link
Contributor

xkubov commented Jul 9, 2020

Hi, so you are interested in the output log of the decompiler? I agree that it might be useful and RetDec should also contain some kind of control mechanism for the output - e.g. silent/verbose decompilation. What do you think @PeterMatula?

@rfalke
Copy link
Author

rfalke commented Jul 10, 2020

I store the output log in https://github.com/rfalke/decompiler-subjects to help others understand what the decompiler "thinks".

For retdec I used a sed to strip the ansi sequences (see https://github.com/rfalke/decompiler-subjects/blob/master/scripts/update_retdec.sh). Since (from my POV) there is a solution I thing the issue can be low-prio. On the other side is a simple switch also easy to implement.

I'm not interested in more elaborated stuff like silent/verbose.

xkubov pushed a commit that referenced this issue Jul 22, 2020
xkubov pushed a commit that referenced this issue Jul 22, 2020
xkubov pushed a commit that referenced this issue Jul 22, 2020
xkubov pushed a commit that referenced this issue Jul 22, 2020
xkubov pushed a commit that referenced this issue Jul 22, 2020
xkubov pushed a commit that referenced this issue Jul 22, 2020
xkubov pushed a commit that referenced this issue Jul 22, 2020
xkubov pushed a commit that referenced this issue Jul 22, 2020
PeterMatula pushed a commit that referenced this issue Jul 23, 2020
* retdec::io: new logging interface

Provides new logging interface that is ment to unify output that
is produced in each part of RetDec decompiler.

The interface is designed to provide eazy management
of logging into files/tty.

Currently each module od decompiler manages logging on its own.
This is not sustainable state as change to logging interface
is rather difficult.

* Use retdec::io interface for logging

* Get rid of llvm-support module

This module is now obsolete as all logging mechanisms
have been transferred to retdec::io module.

* Provide option [-s|--silent]

Provides new option [-s|--silent] for retdec-decompiler executable.
This option will force retdec not to output anything on stdout.

* retdec/config: provide option to specify Log/Error files

Provides way to specify Log/Error files to RetDec.
This is useful for RetDec plugins that might this way
control decompilation output.

* Create loggers from user configuration

* Fix validators error messages

Fixes bug provided by fbbff34.

* Change Log functions to return new object

Provides change to log interface. Before this commit
logging was done on global objects. Now the logging
should be made on temporary objects that are returned
from special functions.

The reason for this is for usage of colors on output.
When temporary object is destructed default color is
printed on required interface.

* Change namespace Log to class Log

This way we can avoid not intentional usage of the
Log interface.

All functions of Log are ment to be used like:

Log::info()
Log::debug()
Log::error()

* Provide missing doxygen

* Fix missing cassert header

Fixes dc57917.

* Enable ANSI colors on Windows

Starting Windows aniversary update Windows terminals provide
supprot for ANSI colors. This, however, needs to be enabled
manually.

More about this can be found here:
https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences?redirectedfrom=MSDN

* utils/io/logger: don't print colors to not supported terminals

* Use macro OS_WINDOWS instead of __has_include

Provides substitution of __has_include macro to OS_WINDOWS defined
in utils/os.h. The reason for this is to maintain a level of
consistency in RetDec source code base.

* Add a CHANGELOG entry for #791
@xkubov
Copy link
Contributor

xkubov commented Jul 29, 2020

RetDec now automatically detects if the output is printed to console or is redirected to file. This should be what you want. If you have a problem with this feature or you would like a different behavior you can open a new issue.

@xkubov xkubov closed this as completed Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants