print static method

void print(
  1. Object? object, {
  2. String? name,
  3. DevLevel level = DevLevel.logNor,
  4. int? colorInt,
  5. bool? isLog,
  6. String? fileLocation,
  7. bool? isDebug,
  8. bool? execFinalFunc,
  9. Object? error,
  10. StackTrace? stackTrace,
})

log supportting on multiple consoles @paramisDebug: default printing only on debug mode, not set using @param static isDebugPrint.

Implementation

static void print(Object? object,
    {String? name,
    DevLevel level = DevLevel.logNor,
    int? colorInt,
    bool? isLog,
    String? fileLocation,
    bool? isDebug,
    bool? execFinalFunc,
    Object? error,
    StackTrace? stackTrace}) {
  final String fileInfo = Dev.isLogFileLocation
      ? (fileLocation != null
          ? '($fileLocation): '
          : '(${StackTrace.current.toString().split('\n')[1].split('/').last}: ')
      : '';
  int ci = colorInt ??
      (_logColorMap[level] ??
          (defaultColorInt ?? (isMultConsoleLog ? 4 : 0)));
  String msg = "$object";
  bool? isDbgPrint = isDebug ?? Dev.isDebugPrint;
  var theName = name ?? level.toString().split('.').last;

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

  DevColorizedLog.logCustom(
    msg,
    enable: Dev.enable,
    colorInt:
        execFinalFunc != null && execFinalFunc ? _exeColorMap[level]! : ci,
    isLog: isLog,
    isMultConsole: true,
    isDebugPrint: isDbgPrint,
    fileInfo: fileInfo,
    name: theName,
    error: error,
    stackTrace: stackTrace,
    execFinalFunc: execFinalFunc,
  );
}