Skip to content

Commit 9209768

Browse files
committed
Use Log class methods
1 parent 63a15e9 commit 9209768

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

products/nativescript/tns_helpers.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import time
55

6+
from core.log.log import Log
67
from core.settings import Settings
78
from core.utils.file_utils import File
89

@@ -50,24 +51,24 @@ def wait_for_log(log_file, string_list, not_existing_string_list=None, timeout=4
5051
log = File.extract_part_of_text(log, verified_flag)
5152
for item in string_list:
5253
if item in log:
53-
print "'{0}' found.".format(item)
54+
Log.info("'{0}' found.".format(item))
5455
else:
5556
not_found_list.append(item)
5657
if not_found_list == []:
5758
all_items_found = True
58-
print "Log contains: {0}".format(string_list)
59+
Log.info("Log contains: {0}".format(string_list))
5960
break
6061
else:
61-
print "'{0}' NOT found. Wait...".format(not_found_list)
62+
Log.info("'{0}' NOT found. Wait...".format(not_found_list))
6263
time.sleep(check_interval)
6364
if 'BUILD FAILED' in log:
64-
print 'BUILD FAILED. No need to wait more time!'
65+
Log.error('BUILD FAILED. No need to wait more time!')
6566
break
6667
if 'Unable to sync files' in log:
67-
print 'Sync process failed. No need to wait more time!'
68+
Log.error('Sync process failed. No need to wait more time!')
6869
break
6970
if 'errors were thrown' in log:
70-
print 'Multiple errors were thrown. No need to wait more time!'
71+
Log.error('Multiple errors were thrown. No need to wait more time!')
7172
break
7273

7374
# Mark that part of the log as verified by appending a flag at the end.
@@ -81,8 +82,7 @@ def wait_for_log(log_file, string_list, not_existing_string_list=None, timeout=4
8182
for item in not_existing_string_list:
8283
assert item not in log, "{0} found! It should not be in logs.\nLog:\n{1}".format(item, log)
8384
else:
84-
print "##### OUTPUT BEGIN #####\n"
85-
print log
86-
print "##### OUTPUT END #####\n"
87-
print ""
85+
Log.debug('##### OUTPUT BEGIN #####\n')
86+
Log.debug(log)
87+
Log.debug('##### OUTPUT END #####\n')
8888
assert False, "Output does not contain {0}".format(not_found_list)

0 commit comments

Comments
 (0)