def log_user_action(self, message, **kwargs): username = os.environ.get('SUDO_USER', pwd.getpwuid(os.getuid()).pw_name) user = get_or_create(self.db, User, name=username) self.db.add( LogEntry(environment='admin', user=user, message=message, **kwargs)) print(message)
def log_user_action(self, message, **kwargs): self.db.add( LogEntry(environment='frontend', user=g.user, message=message, **kwargs), )
def log_user_action(self, message, **kwargs): self.db.add(LogEntry(environment='backend', message=message, **kwargs))