Nicolas Lopez

LogExtensions

import 'dart:developer';
import '../../../utils.dart';
import '../regex/get_utils.dart';
extension GetDynamicUtils on dynamic {
... ... @@ -7,4 +10,10 @@ extension GetDynamicUtils on dynamic {
bool get isNull => GetUtils.isNull(this);
bool get isNullOrBlank => GetUtils.isNullOrBlank(this);
void logError({String info = ''}) =>
GetUtils.log('Error: ${this.runtimeType}', this, info);
void logInfo({String info = ''}) =>
GetUtils.log('Info: ${this.runtimeType}', this, info);
}
... ...
... ... @@ -484,4 +484,7 @@ class GetUtils {
static bool hasMatch(String value, String pattern) {
return (value == null) ? false : RegExp(pattern).hasMatch(value);
}
static void log(String prefix, dynamic value, String info) =>
print('$prefix $value $info');
}
... ...