GithubHelp home page GithubHelp logo

chathurahettiarachchi / errorlogger Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 109 KB

This library will help to track down error logs by creating a database record. This will mainly used in industry based application testing environment. User of the application can generate list of errors that have occurred during time period

License: Apache License 2.0

Java 100.00%
errorlogger database-record android-library

errorlogger's Introduction

ErrorLogger Download

This library will help to track down error logs by creating a database record. This will mainly used in industry based application testing environment. User of the application can generate list of errors that have occurred during time period

libintro

This library contain following functions,

  • ErrorLogger - add
  • ErrorLogger - gerRecord
  • ErrorLogger - getAllRecords
  • ErrorLogger - getMostRecent
  • ErrorLogger - clear

####Let's take a look how to add this to your project

For the android project just include the following dependency inside you build.gradle's depedency list.

Gradle

repositories {
  jcenter()
}

dependencies {
    ...
    compile 'com.chootdev:errorlogger:1.1.1'
}

if you using maven use following Maven

<dependency>
  <groupId>com.chootdev</groupId>
  <artifactId>errorlogger</artifactId>
  <version>1.1.1</version>
  <type>pom</type>
</dependency>

After setup installing lib to your project you just need only to call it using just few lines of code. It will return you a string with the results.

Usage

First to use this ErrorLogger we need to initialize it on our application class. For an example i'll add sample application class

public class SampleApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ErrorLogger.init(this);
    }
}

// ErrorLogger.init(this);
// will create the errorLogger db inside your application

Let's add a new record to created Logger,

ErrorLogger.with(getApplicationContext())
           .add(new LoggerModel("Test title " + i + 1, "Test message " + i + 1));

To get a record from our recorded logs and to get all logs, we can use following functions respectively,

// to get a record
LoggerModel model = ErrorLogger.with(getApplicationContext())
                               .getLogRecord(ID_OF_THE_NEEDED_RECORD);
                               
// to get all records
List<LoggerModel> loggerModels = ErrorLogger.with(getApplicationContext()).getAllRecords();

This will have a clear function to clear data,

ErrorLogger.with(getApplicationContext()).clearLogger();

and to get most recent records, or to get first set of records, you can use this function,

// to get most recent records
List<LoggerModel> loggerModels = ErrorLogger.with(getApplicationContext()).getMostRecent(20,true);

// to get very first set of records
List<LoggerModel> loggerModels = ErrorLogger.with(getApplicationContext()).getMostRecent(20,false);

Limitations

  • Currently min SDK is set to 14

Output Generated

NOTE: Inserting and getting data take time in this generated output. This is not happening when using real world. Just for the demostration

ezgif com-video-to-gif 2

Changelog

  • 1.1.1
    • Fixed crash on log
  • 1.1.0
    • Fixed crashed with getMostRecentRecords
  • 1.0.0
    • Added release v1.0.0

Author

Chathura Hettiarachchi, [email protected]

Checkout my other contributions, https://github.com/ChathuraHettiarachchi?tab=repositories

License

Copyright 2016 Chathura Hettiarachchi

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

errorlogger's People

Stargazers

 avatar  avatar

Watchers

 avatar  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.