-
Notifications
You must be signed in to change notification settings - Fork 28
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
unable to log.OutputToBuf early enough #588
Comments
That will be difficult to achieve given the compile-time plugin structure of protocols and services. If I understand your proposition correctly, you would like to replace the automatic registration of protocols and services with something more user-controlled. Can you be more specific what you're actually trying to achieve? |
In the long run, that would be best; but maybe, it's reaching larger than the scope of this issue.
I'm writing a small CLI which generates a Roster configuration, but outputing this config to stdout gets it gets mangled with the logging from onet. |
So you either write it to a file or put |
I can work around it, that's not the issue. The issue is that I don't have a normal/obvious way to control |
I want to output something to stdout without having the logger writing it on. The issue is that it's already writing quite early on (via the
func init
construct).gives with
DEBUG_LVL=4
A working way to do it (but ugly), is to create a dedicated pkg just containing the
OutputToBuf
call inside aninit
, then importing it before anything else.A better way to fix it would be to avoid
init
everything, especially if the func called have side effects. That's the main issue IMO, thatinit
(and its combo, global variables) is used as a way to avoid having a dedicated struct to contain the state of a given part.The text was updated successfully, but these errors were encountered: