<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -21,8 +21,10 @@ if __name__ == '__main__':
                       default=None, help=&quot;The account's password to use&quot;)
     parser.add_option(&quot;-f&quot;, &quot;--front-end&quot;, dest=&quot;front_end&quot;,
                       default=default_front_end, help=&quot;The frontend to use&quot;)
-    parser.add_option(&quot;-d&quot;, &quot;--debug&quot;, action=&quot;store_true&quot;, dest=&quot;debug&quot;,
+    parser.add_option(&quot;-d&quot;, &quot;--debug-protocol&quot;, action=&quot;store_true&quot;, dest=&quot;debug_protocol&quot;,
                       default=False, help=&quot;Show protocol debug&quot;)
+    parser.add_option(&quot;-D&quot;, &quot;--debug-amsn2&quot;, action=&quot;store_true&quot;, dest=&quot;debug_amsn2&quot;,
+                      default=False, help=&quot;Show amsn2 debug&quot;)
     (options, args) = parser.parse_args()
     
     amsn = aMSNCore(options)</diff>
      <filename>amsn2.py</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,6 @@
 from amsn2 import gui
 from amsn2 import protocol
 from amsn2.backend import aMSNBackendManager
-import papyon
 from views import *
 from account_manager import *
 from contactlist_manager import *
@@ -31,6 +30,13 @@ from theme_manager import *
 from personalinfo_manager import *
 from event_manager import *
 
+import papyon
+import logging
+
+# Top-level loggers
+papyon_logger = logging.getLogger(&quot;papyon&quot;)
+logger = logging.getLogger(&quot;amsn2&quot;)
+
 class aMSNCore(object):
     def __init__(self, options):
         &quot;&quot;&quot;
@@ -72,11 +78,18 @@ class aMSNCore(object):
                     papyon.Presence.INVISIBLE:&quot;hidden&quot;,
                     papyon.Presence.OFFLINE:&quot;offline&quot;}
 
-        import logging
-        if self._options.debug:
-            logging.basicConfig(level=logging.DEBUG)
+        # TODO: redirect the logs somewhere, something like ctrl-s ctrl-d for amsn-0.9x
+        logging.basicConfig(level=logging.WARNING)
+
+        if self._options.debug_protocol:
+            papyon_logger.setLevel(logging.DEBUG)
+        else:
+            papyon_logger.setLevel(logging.WARNING)
+
+        if self._options.debug_amsn2:
+            logger.setLevel(logging.DEBUG)
         else:
-            logging.basicConfig(level=logging.WARNING)
+            logger.setLevel(logging.WARNING)
 
     def run(self):
         self._main.show()
@@ -199,6 +212,7 @@ class aMSNCore(object):
         if self._account is not None:
             self._account.signOut()
         self._loop.quit()
+        logging.shutdown()
 
     # TODO: move to UImanager
     def addContact(self):</diff>
      <filename>amsn2/core/amsn.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c7d7368ef8dd88bb22bb9ea5945ce2e3276c4f1b</id>
    </parent>
  </parents>
  <author>
    <name>Luca Dariz</name>
    <email>luca.dariz@gmail.com</email>
  </author>
  <url>http://github.com/drf/amsn2/commit/f2414aaf2b962057f5740db889bcc076936c1d05</url>
  <id>f2414aaf2b962057f5740db889bcc076936c1d05</id>
  <committed-date>2009-09-01T15:37:49-07:00</committed-date>
  <authored-date>2009-09-01T15:37:49-07:00</authored-date>
  <message>Start managing amsn2 and papyon logs</message>
  <tree>0d6c1ac3c20c6e1239f3b5f7976c06596aa54544</tree>
  <committer>
    <name>Luca Dariz</name>
    <email>luca.dariz@gmail.com</email>
  </committer>
</commit>
