25 lines
400 B
TypeScript
25 lines
400 B
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
} from 'typeorm';
|
|
|
|
@Entity({ name: 'logs' })
|
|
export class Log {
|
|
@PrimaryGeneratedColumn()
|
|
id: number;
|
|
|
|
@Column()
|
|
level: string; // 'log', 'error', 'warn', etc.
|
|
|
|
@Column({ type: String })
|
|
message: string;
|
|
|
|
@Column({ type: String, nullable: true })
|
|
context?: string;
|
|
|
|
@CreateDateColumn()
|
|
timestamp: Date;
|
|
}
|