Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

杨树贤 / kefu_server

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Find file
BlameHistoryPermalink
Switch branch/tag
  • kefu_server
  • ui
  • kefu_workbench
  • lib
  • utils
  • print_util.dart
  • chenxianqi's avatar
    增加kefu_workbench · a18da124
    chenxianqi committed 5 years ago
    a18da124
print_util.dart 656 Bytes
Edit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
import 'package:flutter/material.dart';

import 'datetime_util.dart';

/// 通用打印方法,Release 不会打印,超长字符串分段打印
  void printf(dynamic message) {
    if (message != null) {
      var content = message.toString();
      if (content == '') {
        debugPrint('${DateTimeUtil.dateTimeNowIso()} ');
        return;
      }
      while (content.length > 800) {
        debugPrint(
            '${DateTimeUtil.dateTimeNowIso()} ${content.substring(0, 800)}');
        content = content.substring(800, content.length);
      }
      if (content != '')
        debugPrint('${DateTimeUtil.dateTimeNowIso()} $content');
    }
  }