huridocs/uwazi

View on GitHub
app/api/log.v2/infrastructure/LogEntry.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { Tenant } from 'api/tenants/tenantContext';
import { LogLevel } from './LogLevels';

export class LogEntry {
  message: string;

  timestamp: number;

  level: LogLevel;

  tenant: Tenant;

  constructor(message: string, timestamp: number, level: LogLevel, tenant: Tenant) {
    this.message = message;
    this.timestamp = timestamp;
    this.level = level;
    this.tenant = tenant;
  }

  timeToString(): string {
    return new Date(this.timestamp).toISOString();
  }
}