diff --git a/test_rsync_url.py b/test_rsync_url.py
index 74e05ce..170f714 100644
--- a/test_rsync_url.py
+++ b/test_rsync_url.py
@@ -14,26 +14,27 @@
 
     def log_locals(self, url):
         if url.match:
-            logger.info('RE: "{}"'.format(url.match.pattern))
+            logger.info('Type: {}, RE: "{}"'
+                        ''.format(url.url_type, url.match.pattern))
         logger.info('user "{}", host "{}", port "{}", module "{}", '
                     'path "{}"'.format(url.user, url.host, url.port,
                                        url.module, url.path))
 
     def exact_match_num(self, remote, expected_result):
-        logger.info('"{}" - {}'.format(remote, expected_result))
+        logger.info('For "{}" should be {}'.format(remote, expected_result))
         url = rsync_url.RsyncUrl(remote)
         self.log_locals(url)
         matching_regexps = url._get_all_matching_regexps()
         self.assertEqual(len(matching_regexps), expected_result)
 
     def classed(self, remote, expected_result):
-        logger.info('"{}" - {}'.format(remote, expected_result))
+        logger.info('For "{}" should be {}'.format(remote, expected_result))
         url = rsync_url.RsyncUrl(remote)
         self.log_locals(url)
         self.assertEqual(url.url_type, expected_result)
 
     def parsed(self, remote, expected_result):
-        logger.info('"{}" - {}'.format(remote, expected_result))
+        logger.info('For "{}" should be {}'.format(remote, expected_result))
         url = rsync_url.RsyncUrl(remote)
         self.log_locals(url)
         self.assertEqual(
@@ -42,7 +43,7 @@
         )
 
     def parsed_rsync(self, remote, expected_result):
-        logger.info('"{}" - {}'.format(remote, expected_result))
+        logger.info('For "{}" should be {}'.format(remote, expected_result))
         url = rsync_url.RsyncUrl(remote)
         self.log_locals(url)
         self.assertEqual(
@@ -51,19 +52,19 @@
         )
 
     def valid(self, remote, expected_result):
-        logger.info('"{}" - {}'.format(remote, expected_result))
+        logger.info('For "{}" should be {}'.format(remote, expected_result))
         url = rsync_url.RsyncUrl(remote)
         self.log_locals(url)
         self.assertEqual(url.is_valid, expected_result)
 
     def url(self, remote, expected_result):
-        logger.info('"{}" - {}'.format(remote, expected_result))
+        logger.info('For "{}" should be {}'.format(remote, expected_result))
         url = rsync_url.RsyncUrl(remote)
         self.log_locals(url)
         self.assertEqual(url.url, expected_result)
 
     def urljoin(self, remote, expected_result):
-        logger.info('"{}" - {}'.format(remote, expected_result))
+        logger.info('For "{}" should be {}'.format(remote, expected_result))
         url = rsync_url.RsyncUrl(remote)
         self.log_locals(url)
         for par, er in expected_result.items():
@@ -71,7 +72,7 @@
             self.assertEqual(url.urljoin(par), er)
 
     def dirname(self, remote, expected_result):
-        logger.info('"{}" - {}'.format(remote, expected_result))
+        logger.info('For "{}" should be {}'.format(remote, expected_result))
         url = rsync_url.RsyncUrl(remote)
         self.log_locals(url)
         for par, er in expected_result.items():
@@ -79,7 +80,7 @@
             self.assertEqual(url.dirname(par), er)
 
     def url_in(self, remote, expected_result):
-        logger.info('"{}" - {}'.format(remote, expected_result))
+        logger.info('For "{}" should be {}'.format(remote, expected_result))
         url = rsync_url.RsyncUrl(remote)
         self.log_locals(url)
         for par, er in expected_result.items():
@@ -87,7 +88,7 @@
             self.assertEqual(url.url_in(par), er)
 
     def filename(self, remote, expected_result):
-        logger.info('"{}" - {}'.format(remote, expected_result))
+        logger.info('For "{}" should be {}'.format(remote, expected_result))
         url = rsync_url.RsyncUrl(remote)
         self.log_locals(url)
         for par, er in expected_result.items():
@@ -95,7 +96,7 @@
             self.assertEqual(url.filename(par), er)
 
     def url_is(self, remote, expected_result):
-        logger.info('"{}" - {}'.format(remote, expected_result))
+        logger.info('For "{}" should be {}'.format(remote, expected_result))
         url = rsync_url.RsyncUrl(remote)
         self.log_locals(url)
         for par, er in expected_result.items():
