simple_log

A simple way to upload logs to avenge.cn.

avenge.cn is a log management platform, welcome to try.

中文

Getting Started

  1. Register for free

    https://avenge.cn/register

  2. Install

    dependencies:
        simple_log: ^1.0.3
    
  3. Usage

    import 'package:simple_log/simple_log.dart';
    
    void main(){
      SimpleLog logger = SimpleLog(appId: yourAppId, appKey: 'yourAppKey');
      FlutterError.onError = (FlutterErrorDetails details) {
        logger.e(details);
      };
      runApp(MyApp());
    }
    
  4. Other usages

    simple_logger_example.dart

    SimpleLog logger = SimpleLog(appId: 1, appKey: 'yourAppKey');
    SimpleLog logger2 = SimpleLog(key: 'key2',appId: 2, appKey: 'yourAppKey2');
    
    // default key is "default"
    assert(logger == SimpleLog(key: 'default'));
    
    // debug level
    logger.d("hello world");
    
    // info level
    logger.i("hello world");
    
    // warning level
    logger.w({"a":1,"b":"c"}); 
    
    // error level log will be printed on the local terminal
    logger2.setPrintLevels([Level.Error]);
    
    // error level
    // this log will be printed on the local terminal
    logger2.e(logger); 
    
    logger2.setUploadLevels(null);
    
    // fatal level
    // this log will be printed on the local terminal but will not be uploaded
    logger2.f(["p1", "p2"]); 
    

Libraries

simple_log