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

Two simultaneous outputs #11

Open
xleyba opened this issue Mar 29, 2019 · 1 comment
Open

Two simultaneous outputs #11

xleyba opened this issue Mar 29, 2019 · 1 comment
Labels

Comments

@xleyba
Copy link

xleyba commented Mar 29, 2019

Hi

I would like to send the output to console by default but also send it to JSon file.
I have been able to format the JSon file output but could not figure out how to have both outputs.

Is it possible? If so, could bring me any clue on it?

Thanks in advance
J

@kataras
Copy link
Owner

kataras commented Jun 20, 2019

Hello @xleyba , sorry for the late response. This is actually very easy and we have an example for that case, please read below.

golog supports unlimited number of simultaneously output targets. with AddOutput(io.Writer) method as the _examples/multi-output/main.go does for an os.File. And the good part is that colors are automatically removed from the log line if an output target is not a terminal instance.

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

No branches or pull requests

2 participants