log_legal function usable without a valid user instance as parameter