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

improve logging / debugging #19

Closed
oberon-manjaro opened this issue Feb 12, 2017 · 12 comments
Closed

improve logging / debugging #19

oberon-manjaro opened this issue Feb 12, 2017 · 12 comments
Assignees

Comments

@oberon-manjaro
Copy link
Collaborator

For troubleshooting it will be important to be able to trance back which steps were taking during installation, which packages selected and downloaded.
It would be great to write some kind of a complete logfile to the target install.
Also I haven't really figured out what the best way is to debug during installation. How do you do that currently @Chrysostomus ?

@Chrysostomus
Copy link
Owner

The original script captures most errors and then showed them via dialog window. This makes debugging very frustrating due to the lack of context. That's why I made some parts to just print their errors to stdout. This has a drawback though: without tmux, you can't scroll up to see the errors if there are many.

I would like that we print everything to terminal and tee it to single log file. It is significantly less pretty though.

@oberon-manjaro
Copy link
Collaborator Author

Sounds ok for me. It would even be possible to include a -d switch for stdout and else write to file only. In any case I think it would be good - at least for the rough dev phase - to dump the file to target install at the end so we have something to ask people for. Ideally we should see there even the information about the actual settings that have been selected.
Quit a bit of extra work likely - but it might payoff in the end, what do you think?

@Chrysostomus
Copy link
Owner

I wonder if there could be some shortcut... Like Could we just tee the whole script instead of adding tee everywhere inside it? It could hopefully also capture the dialog windows used (though I have no idea how we could display that... But it is just stuff printed to console/stdout AFAIK)

@Chrysostomus
Copy link
Owner

The script creates quite a few files in /tmp. I usually check those when debugging.

@Chrysostomus
Copy link
Owner

Piping the whole script into tee breaks dialog, so we cannot do that. Apparently we have to insert it into the script.

@oberon-manjaro
Copy link
Collaborator Author

Would it maybe be useful at least to move the existing log instead of wiping it?
Just something like mv /tmp/.errlog /tmp/.errlog0 ?

@Chrysostomus
Copy link
Owner

Yes, definitely. Maybe it would be easiest to modify the check_for_error so it would begin with

 cat /tmp/.errlog >> /tmp/.errlog0

Then we would get a full errorlog. The problem with this is that it is very difficult to know what command the error belongs to... Basestrap commands generate some pretty bad looking but totally harmless errors because some install scripts fail in basestrap situation.

Having combined errlog is the first step. We then also need something to sort the log. Some kind of identifier for commands, which would be >> to errlog0 before the check for error if there is a error.

Before the commands that we check errors for, set operation variable, and add

  echo $operation >> /tmp/.errlog0 

At the beginning of check_for_error?

That way we get a full list of all errors we are interested in, sorted by operation names, while check_for_error still works as intended?

@Chrysostomus
Copy link
Owner

Ah, I see you meant something else...

@oberon-manjaro
Copy link
Collaborator Author

Did I? 😆 Not sure. In any case that ^ sounds good!!

@Chrysostomus
Copy link
Owner

My best ideas come from misunderstanding other people and imagining someone else has already come up with something :D

@oberon-manjaro
Copy link
Collaborator Author

I've proposed something - sorry, only saw your self-assignement just now ;)
For full logging if we want that in some cases it should work to use 2>&1 | tee > <some/dedicated/logfile>, yes. If you want to do the whole thing differently, just let me know :)

@Chrysostomus
Copy link
Owner

No worries, I don't really care who does it.

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