logTitle static method

void logTitle(
  1. String title,
  2. String body, {
  3. int? titleCode,
  4. int? bodyCode,
  5. int? maxBodyChar = 200,
  6. String? prefix,
})

log for 2 line string with color customize
maxBodyChar : max character to show, default: 200\ set null to show all titleCode color of title bodyCode color of body

Implementation

static void logTitle(
  String title,
  String body, {
  int? titleCode,
  int? bodyCode,
  int? maxBodyChar = 200,
  String? prefix,
}) {
  developer.log(
    _getLine('‾'),
    name: prefix ?? 'DMethod',
  );
  developer.log(
    '${_ansiForegroundColor(titleCode)}$title$_resetColor',
    name: prefix ?? 'DMethod',
  );
  developer.log(
    '${_ansiForegroundColor(bodyCode)}$body$_resetColor',
    name: prefix ?? 'DMethod',
  );
  developer.log(
    _getLine('_'),
    name: prefix ?? 'DMethod',
  );
}