Update of /cvsroot/mahogany/M/include
In directory sc8-pr-cvs1:/tmp/cvs-serv17568/include

Modified Files:
        LogCircle.h 
Log Message:
don't hide our explanation behind the 'Details' button, nobody is ever going to see 
them; other minor enhancements in MLogCircle; recognize self-signed SSL certs error 
(bug 840)

Index: LogCircle.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/LogCircle.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -u -2 -r1.1 -r1.2
--- LogCircle.h 4 Jul 2002 17:22:36 -0000       1.1
+++ LogCircle.h 7 Oct 2003 12:41:59 -0000       1.2
@@ -30,19 +30,49 @@
 {
 public:
+   /**
+      Creates an empty log circle.
+
+      @param n the size of the internal buffer, i.e. the number of last error
+               messages stored
+    */
    MLogCircle(int n);
+
+   /// Trivial destructor
    ~MLogCircle();
 
-   void Add(const String &txt);
-   bool Find(const String needle, String *store = NULL) const;
-   String GetLog(void) const;
-   void Clear(void);
+   /**
+      Adds a log message to the buffer.
+
+      This method must be called for all error messages if you want
+      GuessError() to be able to do its job.
+
+      @param txt the error message
+    */
+   void Add(const String& txt);
+
+   /**
+      Forgets the remembered error messages.
+    */
+   void Clear();
 
    /**
-     Looks at log data and guesses what went wrong and calls LOGMESSAGE()
-     if we have any ideas.
+      Looks at log data and tries to guess what went wrong.
+
+      If we could determine the reason for the error, we return the string and
+      also possibly call LOGMESSAGE() with some more explanations. The reason
+      for doing it like this is that the calling code usually does its own
+      LOGERROR() and if we did LOGMESSAGE() directly from this function, our
+      explanation wouldn't be directly visible to the user and as 90% of the
+      users never click on "Details" button, they would never see it at all
+      (and these 90% are also probably those who need to see it most...).
+
+      So instead the caller should append our string, usually after a new line,
+      to the string it passes to LOGERROR().
     */
-   void GuessError(void) const;
+   String GuessError() const;
 
 private:
+   bool Find(const String needle, String *store = NULL) const;
+
    int m_N,
        m_Next;



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to