Coder Social home page Coder Social logo

babihutan / logdna_flutter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aligorithm/logdna_flutter

0.0 0.0 0.0 92 KB

A simple LogDNA client for Flutter. Logging made easy.

Home Page: https://pub.dev/packages/logdna

License: MIT License

Kotlin 1.03% Swift 3.37% Objective-C 0.32% Dart 86.00% HTML 9.27%

logdna_flutter's Introduction

logdna

A simple logdna client for Flutter. Logging made easy.

LogDNA is a log management platform that integrates with many platforms. All logs are accessible in a centralized dashboard with features such as analysis, monitoring, filters and alerts.

Getting Started

To get started, create an account on logdna.com and get your ingestion API key. The set up process is straightforward. Here's a link to the quickstart guide (https://docs.logdna.com/docs/logdna-quick-start-guide).

Installing the package

Add this to your project's pubspec.yaml file

dependencies:
  logdna: ^1.0.0

Run flutter pub get

Usage

Import the package to your Dart code

import 'package:logdna/logdna.dart';

Instantiate the LogDna object

logDna = LogDNA(
        apiKey: "YOUR_API_KEY",
        appName: "APP_NAME",
        hostName: "HOSTNAME");

Add logs using the logDna object.

logDna.log(DnaLine(
      timestamp: DateTime.now().toUtc().millisecondsSinceEpoch.toString(),
      line: "event happened",
      level: DnaLevel.debug,
      env: DnaEnv.production,
      meta: {
        "custom field":"custom value",
        "custom field 2": "custom value 2"
      }
    ));

Alternatively, you can create the log line separately and pass it into the log method.

line = DnaLine(
      timestamp: DateTime.now().toUtc().millisecondsSinceEpoch.toString(),
      line: "event happened",
      level: DnaLevel.debug,
      env: DnaEnv.production,
      meta: {
        "custom field":"custom value",
        "custom field 2": "custom value 2"
      }
    );

You can add custom values after creating the 'DnaLine' instance.

line.addCustomField(CustomField(name:"custom name", value: "Custom value"));

You've pushed your log to LogDNA! Check your LogDNA dashboard. Your new log line should appear.

logdna_flutter's People

Contributors

aligorithm avatar babihutan avatar

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.