diff --git a/sensors/cp_protocol.py b/sensors/cp_protocol.py
index 79f94af..962bf0a 100644
--- a/sensors/cp_protocol.py
+++ b/sensors/cp_protocol.py
@@ -5,9 +5,15 @@
 import zlib
 import json
 import binascii
-import logging
 
-from logger import define_logger
+try:
+    from disk_perf_test_tool.logger import define_logger
+    logger = define_logger(__name__)
+except ImportError:
+    class Logger(object):
+        def debug(self, *dt):
+            pass
+    logger = Logger()
 
 # protocol contains 2 type of packet:
 # 1 - header, which contains template schema of counters
@@ -52,7 +58,6 @@
         self.tmpl_size = 0
         self.packer = packer
 
-
     def new_packet(self, part):
         """ New packet adding """
         # proceed packet
@@ -111,10 +116,8 @@
             else:
                 return None
 
-
         except PacketException as e:
             # if something wrong - skip packet
-            logger = logging.getLogger(__name__)
             logger.warning("Packet skipped: %s", e)
             self.is_begin = False
             self.is_end = False
@@ -122,7 +125,6 @@
 
         except TypeError:
             # if something wrong - skip packet
-            logger = logging.getLogger(__name__)
             logger.warning("Packet skipped: doesn't match schema")
             self.is_begin = False
             self.is_end = False
@@ -130,13 +132,11 @@
 
         except:
             # if something at all wrong - skip packet
-            logger = logging.getLogger(__name__)
             logger.warning("Packet skipped: something is wrong")
             self.is_begin = False
             self.is_end = False
             return None
 
-
     @staticmethod
     def create_packet(data, part_size):
         """ Create packet divided by parts with part_size from data
@@ -160,7 +160,6 @@
 
         return result
 
-
     def create_packet_v2(self, data, part_size):
         """ Create packet divided by parts with part_size from data
             Compressed """
@@ -179,7 +178,6 @@
         result.extend(parts)
         return result
 
-
     def get_matching_value_list(self, data):
         """ Get values in order server expect"""
         vals = range(0, self.tmpl_size)
@@ -188,7 +186,7 @@
             for node, groups in self.clt_template.items():
                 for group, counters in groups.items():
                     for counter, index in counters.items():
-                        if  not isinstance(index, dict):
+                        if not isinstance(index, dict):
                             vals[index] = data[node][group][counter]
                         else:
                             for k, i in index.items():
@@ -201,8 +199,6 @@
             logger.error("Data don't match last schema")
             raise PacketException("Data don't match last schema")
 
-
-
     def create_answer_template(self, perf_string):
         """ Create template for server to insert counter values
             Return tuple of server and clien templates + number of replaces"""
@@ -233,7 +229,3 @@
 
         self.tmpl_size = k
         self.clt_template = json.loads(clt_template)
-
-
-
-define_logger(__name__)
