log static method

void log(
  1. String msg, {
  2. DevLevel level = DevLevel.logNor,
  3. bool? isLog,
  4. int? colorInt,
  5. String? fileLocation,
  6. DateTime? time,
  7. int? sequenceNumber,
  8. String? name,
  9. Zone? zone,
  10. Object? error,
  11. StackTrace? stackTrace,
  12. bool? execFinalFunc,
})

Default color log @paramcolorInt: 0 to 107 @paramisLog: if set to true, the static enable is true or not, log anyway.

Implementation

static void log(
  String msg, {
  DevLevel level = DevLevel.logNor,
  bool? isLog,
  int? colorInt,
  String? fileLocation,
  DateTime? time,
  int? sequenceNumber,
  String? name,
  Zone? zone,
  Object? error,
  StackTrace? stackTrace,
  bool? execFinalFunc,
}) {
  int ci = colorInt ??
      (_logColorMap[level] ??
          (defaultColorInt ?? (isMultConsoleLog ? 4 : 0)));
  final String fileInfo = Dev.isLogFileLocation
      ? (fileLocation != null
          ? '($fileLocation): '
          : '(${StackTrace.current.toString().split('\n')[1].split('/').last}: ')
      : '';
  final levelMap = {DevLevel.logWar: 1000, DevLevel.logErr: 2000};
  final theName = name ?? level.toString().split('.').last;

  DevColorizedLog.logCustom(
    msg,
    enable: Dev.enable,
    colorInt:
        execFinalFunc != null && execFinalFunc ? _exeColorMap[level]! : ci,
    isLog: isLog,
    fileInfo: fileInfo,
    time: time,
    sequenceNumber: sequenceNumber,
    level: levelMap[level] ?? 0,
    name: theName,
    zone: zone,
    error: error,
    stackTrace: stackTrace,
    execFinalFunc: execFinalFunc,
  );
}