병홍 2022. 1. 14. 09:37

제가 사용하고 있는 Log 라이브러리 추천해드립니다. 

사실 가장 많이 사용되고 있는 것 같아 보이기도 합니다. ^^

 

깔끔하고 보기 좋아서 시작부터 설치하고 사용하세요~

 

 

  1. 사용법도 간단합니다.
    logger.v("Verbose log");
    
    logger.d("Debug log");
    
    logger.i("Info log");
    
    logger.w("Warning log");
    
    logger.e("Error log");
    
    logger.wtf("What a terrible failure log");
  2. 로그 튜닝도 가능하고, 로그별로 색상도 다르고... 아주 좋습니다. 
    var logger = Logger(
      printer: PrettyPrinter(
        methodCount: 2, // number of method calls to be displayed
        errorMethodCount: 8, // number of method calls if stacktrace is provided
        lineLength: 120, // width of the output
        colors: true, // Colorful log messages
        printEmojis: true, // Print an emoji for each log message
        printTime: false // Should each log print contain a timestamp
      ),
    );


 

 

https://pub.dev/packages/logger

 

logger | Dart Package

Small, easy to use and extensible logger which prints beautiful logs.

pub.dev