exe static method

void exe(
  1. String msg, {
  2. String? name,
  3. DevLevel level = DevLevel.logNor,
  4. bool? isLog,
  5. bool? isMultConsole,
  6. bool? isDebug,
  7. int? colorInt,
  8. String? fileInfo,
})

Execute custom final func with purple text or blue text with mult console

Implementation

static void exe(
  String msg, {
  String? name,
  DevLevel level = DevLevel.logNor,
  bool? isLog,
  bool? isMultConsole,
  bool? isDebug,
  int? colorInt,
  String? fileInfo
  }) {
  int ci = colorInt ?? (_exeColorMap[level] ?? 95);
  final String theFileInfo = Dev.isLogFileLocation ? (fileInfo ?? '(${StackTrace.current.toString().split('\n')[1].split('/').last}: ') : '';
  bool isMult = isMultConsole != null && isMultConsole;
  var theName = name ?? level.toString().split('.').last;
  bool? isDbgPrint = isDebug ?? Dev.isDebugPrint;
  final levelMap = {DevLevel.logWar: 1000, DevLevel.logErr: 2000};

  if (isMult) {
    final prefix = isDbgPrint == null || isDbgPrint ? 'dbgPrt' : 'unlPrt';
    theName = theName.replaceAll('log', prefix);
  }

  DevColorizedLog.logCustom(
    msg,
    enable: Dev.enable,
    colorInt: ci,
    isLog: isLog,
    isMultConsole: isMultConsole,
    isDebugPrint: isDbgPrint,
    fileInfo: theFileInfo,
    name: theName,
    level: levelMap[level] ?? 0,
    execFinalFunc: true,
  );
}