def log (this, *s, mode='LOG', **k): path = this.path if not os.path.exists(path): os.makedirs(path) today = getToday() if this.today != today: this.today = today this.no = 0 file = this._getFileName() filePath = os.path.join(path, file) while os.path.exists(filePath) and maxFileSize < os.path.getsize(filePath): this.no += 1 file = this._getFileName() filePath = os.path.join(path, file) sep = k.get('sep', this.sep) k = {x : k[x] for x in k if x not in {'sep', 'file'}} fprint(f'[{mode}] ({getNow()})', file=file, path=path, end=' ') fprint(*s, **k, file=file, path=path, sep=sep)
def ourLog(name, log, logType=''): fprint(f'[LOG] ({getNow()}) {repr(name)} : {logType} : {repr(log)}\n', file='log.txt', path='log')
def ourError(name, error, errorType=''): fprint( f'[ERROR] ({getNow()}) {repr(name)} : {errorType} : {repr(error)}\n', file='error.txt', path='error')
def ourLog(log, logType=''): path = os.path.join(__path__, f'log{vGlobals.timeManagerType}') fprint(f'[LOG] ({getNow()}) {logType} : {repr(log)}', file=f'log{getToday()}.txt', path=path)
def ourError(error, errorType=''): path = os.path.join(__path__, f'error{vGlobals.timeManagerType}') fprint(f'[ERROR] ({getNow()}) {errorType} : {repr(error)}', file=f'error{getToday()}.txt', path=path)