Ticket #163 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

separate debug settings from xsession

Reported by: erikos Owned by: marcopg
Priority: major Milestone:
Component: sugar Version: Git as of bugdate
Severity: Keywords: r+
Cc: tomeu Distribution/OS:
Bug Status:

Description

The attached patch does look for a file in the old .xsession format in ~/.sugar/debug

The sugar executable then source this file. This leaves us the option to customize the debugging options. SUGAR_LOGGER_LEVEL should be turned on by default.

I made it ~/.sugar/debug to be global to instances when running multiple emulators (~/.sugar/default, ~/.sugar/erikos2).

Attachments

debug Download (452 bytes) - added by erikos 4 years ago.
an debug option file example
separate_debug_from_xsession.patch Download (404 bytes) - added by erikos 4 years ago.
source the debug options in the sugar executable
separate_debug_from_xsession_2.patch Download (0.9 KB) - added by erikos 4 years ago.
source the debug options in the sugar executable; create debug file on profile creation
write_debug_file_in_profile_163.patch Download (1.2 KB) - added by erikos 4 years ago.
the corresponding sugar-toolkit patch

Change History

Changed 4 years ago by erikos

an debug option file example

Changed 4 years ago by erikos

source the debug options in the sugar executable

  Changed 4 years ago by erikos

  • priority changed from minor to major

  Changed 4 years ago by marcopg

  • cc tomeu added
  • keywords r- added; r? removed

I think we need an easy to turn on all the useful debug switches, without having to type/copy something long as in your example. One option would be to install a debug file somewhere you can cp to ~/.sugar. Another to move the exports inside the sugar script (just check for ~/.sugar/debug existence) and have people edit them directly if they want to tweak the debug flags. I tend to prefer the second approach. Tomeu, do you have thoughts on this?

  Changed 4 years ago by marcopg

Hmmm I'm actually not satisfied with editing the sugar script to tweak flags. They would be overwritten when you upgrade/reinstall.

  Changed 4 years ago by marcopg

What about creating ~/.sugar/debug on profile setup, with everything commented out?

follow-up: ↓ 6   Changed 4 years ago by erikos

Hmm I think there was some misunderstanding. The example i posted was meant to be installed to ~/.sugar/default And everything is commented out except the SUGAR_LOGGER_LEVEL so we get debug messages by default. So people can just uncomment the options if they like to - like we had with the old approach as well.

in reply to: ↑ 5   Changed 4 years ago by marcopg

Replying to erikos:

Hmm I think there was some misunderstanding. The example i posted was meant to be installed to ~/.sugar/default

You mean ~/.sugar/debug? What/how installs it there?

  Changed 4 years ago by erikos

Yeah, like you said the profile code could write the ./sugar/debug - i will post a full patch later.

Changed 4 years ago by erikos

source the debug options in the sugar executable; create debug file on profile creation

Changed 4 years ago by erikos

the corresponding sugar-toolkit patch

  Changed 4 years ago by erikos

  • keywords r? added; r- removed

  Changed 4 years ago by tomeu

  • keywords r+ added; r? removed

Sounds good to me, though I think what other projects do is to ship such an example file in /usr/share/docs/examples and tell people to copy it to their ~.

  Changed 4 years ago by erikos

  • status changed from new to closed
  • resolution set to fixed

Thanks for the review. As we need to make getting debug infos as easy as possible we settled on this solution. Pushed to git sugar and sugar-toolkit

Note: See TracTickets for help on using tickets.