투케이2K

7. (Flutter/플러터) [Mac] : [Dart] : 다트 - 기본 로그 출력 방법 설명 - print , debugPrint , log 본문

Flutter

7. (Flutter/플러터) [Mac] : [Dart] : 다트 - 기본 로그 출력 방법 설명 - print , debugPrint , log

투케이2K 2024. 5. 19. 19:37
반응형

[개발 환경 설정]

개발 툴 : AndroidStudio

개발 언어 : Dart

 

[소스 코드]

import 'package:flutter/material.dart';
import 'dart:developer';


// -----------------------------------------------------------------------------------------
// TODO [main] : [application 의 진입점 역할]
// -----------------------------------------------------------------------------------------
void main() {

  /**
   * ------------------------------------------------
   * [요약 설명]
   * ------------------------------------------------
   * 1. print : release mode로 빌드해도, logcat등에 그대로 출력됩니다
   * ------------------------------------------------
   * 2. debugPrint : debug mode에서만 출력되며, release mode에서는 무시됩니다
   * ------------------------------------------------
   * 3. log : debugPrint()와 유사하나, 콘솔, 파일, 시스템로그, 원격 로그와 같이 출력 대상을 다양하게 지정할 수 있습니다
   * ------------------------------------------------
   * */

  // [print 출력]
  print("hello print");

  // [debugPrint 출력]
  debugPrint("hello debugPrint");

  // [log 출력]
  log("hello log");

}
 

[결과 출력]


반응형
Comments