15 lines
514 B
Python
15 lines
514 B
Python
import sqlite3
|
|
from datetime import datetime
|
|
from models.log import Log
|
|
from models.database import Database
|
|
|
|
class LogService:
|
|
@staticmethod
|
|
def createlog(username, description, additional_information, suspicious):
|
|
now = datetime.now()
|
|
date_string = now.strftime("%d-%m-%Y")
|
|
time_string = now.strftime("%H:%M:%S")
|
|
new_log = Log(Database.connection, None, username, date_string, time_string, description, additional_information, suspicious)
|
|
|
|
new_log.save()
|