armory/blender/arm/log.py

22 lines
461 B
Python
Raw Normal View History

2017-03-15 12:30:14 +01:00
info_text = ''
num_warnings = 0
2016-10-19 13:28:06 +02:00
def clear(clear_warnings=False):
global info_text, num_warnings
2017-03-15 12:30:14 +01:00
info_text = ''
if clear_warnings:
num_warnings = 0
2016-10-19 13:28:06 +02:00
def format_text(text):
return (text[:80] + '..') if len(text) > 80 else text # Limit str size
2016-11-12 18:30:39 +01:00
2016-10-19 13:28:06 +02:00
def print_info(text):
2017-03-15 12:30:14 +01:00
global info_text
2016-10-19 13:28:06 +02:00
print(text)
2017-03-15 12:30:14 +01:00
info_text = format_text(text)
2016-11-05 20:57:04 +01:00
def warn(text):
global num_warnings
num_warnings += 1
2016-11-05 20:57:04 +01:00
print('Armory Warning: ' + text)