import { Dayjs } from "dayjs"; import { APIClient } from "./ApiClient"; export type LogSeverity = "Debug" | "Info" | "Warn" | "Error"; export interface LogEntry { device_id: string; time: number; severity: LogSeverity; message: string; } export class LogsAPI { /** * Request the logs from the server * * @param date The date that contains the requested date */ static async GetLogs(date: Dayjs): Promise { const day = Math.floor(date.unix() / (3600 * 24)); const res = await APIClient.exec({ uri: `/logging/logs?day=${day}`, method: "GET", }); return res.data; } }