diff --git a/examples/qidle/qidle.py b/examples/qidle/qidle.py
index <HASH>..<HASH> 100644
--- a/examples/qidle/qidle.py
+++ b/examples/qidle/qidle.py
@@ -1,13 +1,13 @@
 #! /usr/bin/python3
 # -*- coding: utf-8 -*-
+import logging
 import sys
+filename = None
+if sys.platform == 'win32':
+    filename = 'qidle.log'
+logging.basicConfig(level=logging.INFO, filename=filename)
 from qidle import main
-import logging
 
 
 if __name__ == '__main__':
-    filename = None
-    if sys.platform == 'win32':
-        filename = 'qidle.log'
-    logging.basicConfig(level=logging.INFO, filename=filename)
     main()
QIdle: setup logging before importing pyqode

so that the qt api log appears