Logger.logr.error("'%s' doesn't exist...", files[0]) for i in range(1,4): try: with open(files[i]) as f: Logger.logr.debug("'%s' exists...", files[i]) except IOError: Logger.logr.error("'%s' doesn't exist...", files[i]) def main(): Logger.logr.info("Bonjour!") template_function() Logger.logr.info("Au revoir!") ############################################################################## # main ############################################################################## if __name__ == '__main__': header() banner("Execution...") status=main() footer(status) ############################################################################## # eof ##############################################################################
returns total elapsed time ''' total = t.time() - self._start return "total elapsed time: %.2f s" % total ############################################################################## # main ############################################################################## if __name__ == '__main__': from logUtils import Logger header() banner('Autotest...') test_chronometre = startChrono() t.sleep(1) Logger.logr.info(test_chronometre.partial()) t.sleep(1) Logger.logr.info(test_chronometre.partial()) t.sleep(1) Logger.logr.info(test_chronometre.partial()) Logger.logr.info(test_chronometre.stop()) footer() ############################################################################## # eof ##############################################################################