import 'package:json_annotation/json_annotation.dart';

part 'system_log.g.dart';

@JsonSerializable()
class SystemLogResponse {
  final List<String> logs;

  SystemLogResponse({
    required this.logs,
  });

  factory SystemLogResponse.fromJson(Map<String, dynamic> json) =>
      _$SystemLogResponseFromJson(json);

  Map<String, dynamic> toJson() => _$SystemLogResponseToJson(this);
}

enum LogLevel {
  @JsonValue('debug')
  debug,
  @JsonValue('info')
  info,
  @JsonValue('warn')
  warn,
  @JsonValue('error')
  error;

  String get name {
    switch (this) {
      case LogLevel.debug:
        return 'debug';
      case LogLevel.info:
        return 'info';
      case LogLevel.warn:
        return 'warn';
      case LogLevel.error:
        return 'error';
    }
  }
}
