first commit

This commit is contained in:
2025-03-03 20:59:42 +03:00
commit 273e68557a
1099 changed files with 17880 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
import 'package:remever/common/typedef.dart';
enum LogLevel {
ERROR,
INFO,
SUCCESS,
DEBUG,
WARNING;
String get errName {
switch (this) {
case LogLevel.ERROR:
return 'ERROR';
case LogLevel.INFO:
return 'INFO';
case LogLevel.SUCCESS:
return 'SUCCESS';
case LogLevel.DEBUG:
return 'DEBUG';
case LogLevel.WARNING:
return 'WARNING';
}
}
}
class LogEntity {
LogEntity({
required this.level,
required this.message,
this.context = const <String, dynamic>{},
});
LogEntity.error({
required this.message,
this.context = const <String, dynamic>{},
}) : level = LogLevel.ERROR;
LogEntity.info({
required this.message,
this.context = const <String, dynamic>{},
}) : level = LogLevel.INFO;
LogEntity.success({
required this.message,
this.context = const <String, dynamic>{},
}) : level = LogLevel.SUCCESS;
LogEntity.debug({
required this.message,
this.context = const <String, dynamic>{},
}) : level = LogLevel.DEBUG;
LogEntity.warning({
required this.message,
this.context = const <String, dynamic>{},
}) : level = LogLevel.WARNING;
final LogLevel level;
final String message;
final Json context;
}