warn static method
void
warn(})
Implementation
static void warn(dynamic message, {DateTime? time, Object? error, StackTrace? stackTrace, bool isReport = true, required String actionModule, required String actionName}) {
if (isLogPathInitialized(message)) {
try {
if (isMobile) {
MXLogger.instance.warn(message, name: actionModule, tag: actionName);
} else {
logger.w(
jsonEncode({
"time": time?.toIso8601String() ?? DateTime.now().toIso8601String(),
"sequence": _sequence,
"message": message,
"actionModule": actionModule,
"actionName": actionName,
"error": error.toString(),
"stackTrace": stackTrace?.toString(),
}),
time: time ?? DateTime.now(),
error: error,
stackTrace: stackTrace ?? StackTrace.current,
);
}
} catch (_) {}
if (isReport) {
_sequence++;
report(TCICLogParam(sequence: _sequence, module: actionModule, action: actionName, param: message, level: "warn", code: -3, desc: "Warning", stack: stackTrace.toString()));
}
}
}