Flutter's sync log component implementation by DartNative.

Related tags

Utilities ffi_log
Overview

ffi_log

Flutter's sync log component implementation by DartNative.

Supported Platforms

iOS & Android

Usage

Dart code :

// init log
FFILog.init();

// log message
FFILog.debug("MyApp", "log debug");
FFILog.info("MyApp", "log info");
FFILog.warn("MyApp", "log warn");
FFILog.error("MyApp", "log error", stackTrace: StackTrace.current);

Objective-C code:

// implementation FFILogDelegate
@interface LogImpl() 
@end

@implementation LogImpl
- (int)getLogLevel {
    return FFILogLevelAll;
}

- (void)printLog:(int)level tag:(NSString *)tag content:(NSString *)content {
    // native logger
    NSLog(@"native log|%zd|%@|%@", level, tag, content);
}
@end

// set implementation
[FFILog sharedInstance].delegate = [[LogImpl alloc] init];

Java code:

// set FFILog.ILog implementation
FFILog.setLog(new FFILog.ILog() {
    @Override
    public void printLog(int level, String tag, String content) {
        switch (level) {
            case FFILog.ILog.ERROR:
                Log.e(tag, content);
                break;
            case FFILog.ILog.WARN:
                Log.w(tag, content);
                break;
            case FFILog.ILog.INFO:
                Log.i(tag, content);
                break;
            case FFILog.ILog.DEBUG:
                Log.d(tag, content);
                break;
            default:
                break;
        }
    }

    @Override
    public int getLogLevel() {
        return FFILog.ILog.ALL;
    }

    // If dartnative so path is custom, return so path.
    // Otherwise return null.
    @Override
    public String getCustomDartNativePath() {
        return null;
    }
});

License

ffi_log is available under the BSD 3-Clause License. See the LICENSE file for more info.

You might also like...

Cache json map to local file with Dart:io. Read file with sync api.

local_cache_sync 一个非常简单易用的Flutter本地储存库,适用于在本地储存一列轻量数据(例如用户保存在本地的设备信息,或者缓存一系列用户信息)。 local_cache_sync的所有方法都是同步,而不是异步的。这意味着你不需要使用await就可以获取数据。在flutter中,这

Jun 24, 2022

📝 Simple text editor/notepad with cloud sync.

txt Simple text editor/notepad with cloud sync. Build Install dependencies: flutter pub get Build: flutter build apk, flutter build ios etc. ToDo's Ad

Jan 1, 2023

Simple app for both Android and Windows to sync Audio Trip songs from the Audio Trip Choreography Discord

ATCD Choreography Sync Simple app for both Android (Oculus Quest native) and Windows (PCVR) to sync Audio Trip songs from the Audio Trip Choreography

Nov 15, 2022

A productivity manager application, designed to sync across your devices

A productivity manager application, designed to sync across your devices

Potato A productivity manager application, designed to sync across your devices, it currently supports macOS! Demo Kapture.2022-08-22.at.11.10.44.mp4

Sep 15, 2022

an internship log book desktop app

an internship log book desktop app

LogBook Desktop App an internship log book desktop app Table of contents LogBook Desktop App Table of contents Features Log Book Format Demo Screensho

Sep 17, 2022

Log snapshot management solution (iOS/Android/Web/Server) built with Flutter/Dart using Bloc pattern and Firebase Firestore backend.

Log snapshot management solution (iOS/Android/Web/Server) built with Flutter/Dart using Bloc pattern and Firebase Firestore backend.

Log snapshot management solution (iOS/Android/Web/Server) built with Flutter/Dart using Bloc pattern and Firebase Firestore backend.

Nov 9, 2022

A Flutter Log In Page using Flare Animations

A Flutter Log In Page using Flare Animations

Bear_log_in An example built using JCToon's Flare File as a custom UI component. Bear will follow the cursor as you type or move it around. Overview T

Oct 19, 2022

A log in page for Abbey Foods app using Flutter

A log in page for Abbey Foods app using Flutter

Abbey-Foods-App-Log-In-Page A log in page for Abbey Foods' app using Flutter. This is the capstone project assigned to Group 11, MObile App developmen

Oct 17, 2022

How login , register and log out Firebase Textformfield with focusNode. InheritedWidget example.

How login , register and log out Firebase Textformfield with focusNode. InheritedWidget example.

flutter_fire_base_register How login, register and log out Firebase. Textformfield with focusNode InheritedWidget exam. Stream provider usage. App Hom

May 8, 2021

All four are used to log into a Firebase backend.

All four are used to log into a Firebase backend.

Auth This library package works with four plugins: firebase_auth google_sign_in flutter_facebook_login flutter_twitter All four are used to log into a

Dec 14, 2022

A simple log catch server powered by flutter.

flutter_logcat A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Jan 9, 2022

Simple access log parsing for zabbix (tested with nginx)

Simple access log parsing for zabbix (tested with nginx)

zabbix-nginx-stats Simple script to import basic nginx statistics into zabbix. It parses the log file (currently only supports one basic format) and p

Mar 18, 2022

The ArDrive Web App allows a user to log in to securely view, upload and manage their ArDrive files.

ArDrive Web The ArDrive Web App allows a user to log in to securely view, upload and manage their ArDrive files. Have any questions? Join the ArDrive

Dec 14, 2022

A flutter plugin to get facebook deep links and log app events using the latest Facebook SDK to include support for iOS 14

Facebook Sdk For Flutter LinkedIn GitHub facebook_sdk_flutter allows you to fetch deep links, deferred deep links and log facebook app events. This wa

Dec 17, 2022

A visualized dynamic programming for log collection based on flutter.

A visualized dynamic programming for log collection based on flutter. Pub使用 1. Depend on it Add this to your package's pubspec.yaml dependencies: mag

Nov 22, 2022

Console log package

Console log package

Console log package Usage Download ServerLog application for mac os, window and linux In the main.dart set logEnable = true for release mode Console.l

Sep 13, 2022

A music player component for Flutter (i.e. Spotify, Apple Music, etc.) [AGPL/example/no longer maintaining]

A music player component for Flutter (i.e. Spotify, Apple Music, etc.) [AGPL/example/no longer maintaining]

This is an example I currently have no plans of putting this on Pub. Originally, I did, but I lost interest. However, I think this is a good example,

Dec 12, 2022

A music player component for Flutter

A music player component for Flutter

This is an example I currently have no plans of putting this on Pub. Originally, I did, but I lost interest. However, I think this is a good example,

Dec 12, 2022
Owner
DartNative
DartNative
Log snapshot management solution (iOS/Android/Web/Server) built with Flutter/Dart using Bloc pattern and Firebase Firestore backend.

Log snapshot management solution (iOS/Android/Web/Server) built with Flutter/Dart using Bloc pattern and Firebase Firestore backend.

Alexey Perov 5 Nov 9, 2022
A Gura parser implementation for Dart

Gura Dart parser This repository contains the implementation of a Gura configuration format parser for Dart, written in pure Dart. (Compliant with spe

Zack Campbell 4 Aug 2, 2021
Provides null-safety implementation to simplify JSON data handling by adding extension method to JSON object

Lazy JSON Provides null-safety implementation to simplify JSON data handling by adding extension method to JSON object and JSON array. Getting started

Kinnara Digital Studio 0 Oct 27, 2021
Flutter implementation of Clean Architecture, inspired on the guidelines created by Uncle Bob.

clean_framework Flutter implementation of Clean Architecture, inspired on the guidelines created by Uncle Bob. see http://www.amazon.com/dp/0134494164

Acme Software 21 Dec 13, 2022
A pure Dart implementation of the Pusher Channels Client

pusher_channels is a pure Dart pusher channels client. This client is work in progress and it is unstable. Usage A simple usage example: import 'packa

Indaband 7 Nov 6, 2022
Reference implementation for the Zenon SDK for Dart and Flutter apps compatible

Zenon Dart SDK Reference implementation for the Zenon SDK for Dart and Flutter apps compatible with the Zenon Alphanet - Network of Momentum Phase 0.

null 8 Nov 23, 2022
Reflectable is a Dart library that allows programmers to eliminate certain usages of dynamic reflection by specialization of reflective code to an equivalent implementation using only static techniques

Reflectable is a Dart library that allows programmers to eliminate certain usages of dynamic reflection by specialization of reflective code to an equivalent implementation using only static techniques. The use of dynamic reflection is constrained in order to ensure that the specialized code can be generated and will have a reasonable size.

Google 318 Dec 31, 2022
A Flutter inplementation of the reorderable grid UI pattern, closely mimics Flutters exisiting ReorderableList

?? Reorderable Grid A full reorderable grid implemention similar to Flutters Reorderable_List. with full ReorderableGridView, ReorderableGrid and Sliv

Cas van Luijtelaar 35 Dec 20, 2022
a project for learning all Flutter Widgets , sync from flutter.dev the officia website.

Flutter Widgets Catalog (WIP) 计划 1、使用Flutter开发一个全平台的Flutter Widgets Catalog APP,并且开源。在这个APP中可以通过图形化的方式查看所有Widgets的介绍,示例,视频教程。 2、所有文档内容由前一天从flutter.dev

ezshine 32 Aug 3, 2022