Opened 12 years ago

Closed 12 years ago

#163 closed enhancement (fixed)

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 (4)

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

Download all attachments as: .zip

Change History (14)

Changed 12 years ago by erikos

an debug option file example

Changed 12 years ago by erikos

source the debug options in the sugar executable

comment:1 Changed 12 years ago by erikos

  • Priority changed from minor to major

comment:2 Changed 12 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?

comment:3 Changed 12 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.

comment:4 Changed 12 years ago by marcopg

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

comment:5 follow-up: Changed 12 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.

comment:6 in reply to: ↑ 5 Changed 12 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?

comment:7 Changed 12 years ago by erikos

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

Changed 12 years ago by erikos

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

Changed 12 years ago by erikos

the corresponding sugar-toolkit patch

comment:8 Changed 12 years ago by erikos

  • Keywords r? added; r- removed

comment:9 Changed 12 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 ~.

comment:10 Changed 12 years ago by erikos

  • Resolution set to fixed
  • Status changed from new to closed

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.