-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a pluggable logging backend (#124)
* refork & resync and address changes * fix the typo * use `user_model` instead of `user` when `user_login_failed`
- Loading branch information
1 parent
0e720f3
commit c9081e1
Showing
6 changed files
with
127 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import logging | ||
from easyaudit.models import RequestEvent, CRUDEvent, LoginEvent | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class ModelBackend: | ||
|
||
def request(self, request_info): | ||
return RequestEvent.objects.create(**request_info) | ||
|
||
def crud(self, crud_info): | ||
return CRUDEvent.objects.create(**crud_info) | ||
|
||
def login(self, login_info): | ||
return LoginEvent.objects.create(**login_info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters