Git Product home page Git Product logo

flutter_socket_log_plugin's Introduction

PRs Welcome pub package

flutter_socket_log_plugin

Logging flutter apps to remote using socket. In order to connect to remote app, you need to be in the same local network. The tester will be able to see all the logs inside the client app.

You can find the client app source code here.

Client application to watch logs

Horizontal

Installation

Add

flutter_socket_log_plugin : # latest version

or run

flutter pub add flutter_socket_log_plugin

How to Use

Install Client Application

Install client app using the flutter source code for windows, linux, mac, android, ios or install app for windows and android.

Basic Usage
Initialize the plugin in main function
void main() {
  	// add conditions to initialize the plugin
  	FlutterSocketLogPlugin.init(appName: 'Dummy App');
  	runApp(const MyApp());
}
Log to remote client app
FlutterSocketLogPlugin.log(
   'Write your logs', 
   DefaultLogs.debug, // customize logs if you want
   [DefaultLogs.network], // add your log tags, customize tags
);
Customize Log Levels and Log Tags
Initialize your log tag and log level
List<LogLevel> logLevels = [
  FlutterSocketLogPlugin.createLogLevel(
    'Critical',
    Colors.cyan.value,
    Icons.warning.codePoint,
  ),
  FlutterSocketLogPlugin.createLogLevel(
    'Alert',
    Colors.red.value,
    Icons.error.codePoint,
  )
];

List<LogTag> logTags = [
  FlutterSocketLogPlugin.createTag(
    'Request',
    Colors.blue.value,
    Icons.network_wifi.codePoint,
  ),
  FlutterSocketLogPlugin.createTag(
    'Response',
    Colors.green.value,
    Icons.network_wifi.codePoint,
  ),
];
Add customizations to init function
FlutterSocketLogPlugin.init(
  appName: 'Customized App',
  logLevels: logLevels,
  logTags: logTags,
);
Start Logging
FlutterSocketLogPlugin.log(
  'Write your logs here',
  logLevels[0],
  [
    logTags[0],
    logTags[1],
  ]
);
Once you define your custom methods it could be as simple as this:
Logger.debugNetwork('Write your log here');

Log Tags and Log Levels

Log Tags and Log Levels are customizable which means that you can create your own by custom names, colors as well as icons. As a result you can get those in the client application.

flutter_socket_log_plugin's People

Contributors

khamidjon-khamidov avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

ramdasoutlogics

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.