Лялюшкин - Лабораторная работа #3

yeah, it's better to wrap this check in new method than every time write it. 
then I should create similar for getting log