~ubuntu-branches/ubuntu/precise/gnome-do/precise-proposed

« back to all changes in this revision

Viewing changes to Do/src/Log.cs

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2008-09-14 10:09:40 UTC
  • mto: (0.1.8 sid)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20080914100940-kyghudg7py14bu2z
Tags: upstream-0.6.0.0
ImportĀ upstreamĀ versionĀ 0.6.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
 
63
63
                string AlignMessage (string msg, int margin)
64
64
                {
65
 
                        int maxWidth   = 90;
 
65
                        int maxWidth   = 80;
66
66
                        int lineWidth  = 0;
67
 
                        string aligned = "";
68
 
                        string padding = "";
 
67
                        string aligned = string.Empty;
 
68
                        string padding = string.Empty;
69
69
                        string[] words = msg.Split (' ');
70
70
 
71
71
                        while (padding.Length < margin)
77
77
                                        aligned = string.Format ("{0}{1} ", aligned, word);
78
78
                                        lineWidth += word.Length + 1;
79
79
                                } else {
80
 
                                        aligned = string.Format ("{0}\n{1}{2} ", aligned, padding, word);
81
 
                                        lineWidth = margin + word.Length + 1;
 
80
                                        aligned = string.Format ("{0}\n    {1} ", aligned, word);
 
81
                                        lineWidth = 4 + word.Length + 1;
82
82
                                }
83
83
                        }
84
84
                        return aligned;
105
105
                
106
106
                static Log ()
107
107
                {
108
 
                        if (Do.Preferences.BeQuiet)
109
 
                                level = LogEntryType.Error;
110
 
                        else
111
 
                                level = LogEntryType.Info;
 
108
                        level = Do.Preferences.QuietStart ? LogEntryType.Error
 
109
                                                                                          : LogEntryType.Info;
112
110
                        logs = new List<ILog> ();
113
111
                }
114
112