コード例 #1
0
ファイル: benchprint.py プロジェクト: andyspiros/numbench
    def __call__(self, arg='', end='\n'):
        printstr = str(arg) + end
        if self._level > 0:
            printstr = (self._level - 1) * "  " + "-- " + printstr

        # Print to logfile
        bu.mkdir(dirname(self._logfile))
        logfile = file(self._logfile, 'a')
        print >> logfile, printstr,
        logfile.close()

        # Print to terminal
        if self._level <= self._maxlevel:
            print printstr,