Coder Social home page Coder Social logo

abumq / residue-java Goto Github PK

View Code? Open in Web Editor NEW
0.0 4.0 1.0 302 KB

Official Java client library to interact with residue logging server seamlessly.

License: Other

Shell 0.45% Java 99.55%
residue-client java-library remote-logging logging-library java android-library android-logger residue residue-tools

residue-java's Introduction

Residue Java Client

Version GitHub license

Introduction

This library provides you interface to connect to the residue seamlessly and use it as your central logging library.

Please note, until first stable release we are not providing JAR file for this library. Please feel free to import the relevant code in to your library.

For regular java project you will need Residue.java and Base64.java

For android project you will also need ResidueConnectTask.java

Dependencies

Download Dependencies

mkdir lib
wget https://abumq.github.io/downloads/bcprov-jdk15on-156.jar -O lib/bcprov-jdk15on-156.jar ## BouncyCastle
wget https://abumq.github.io/downloads/gson-2.6.2.jar -O lib/gson-2.6.2.jar ## GSON

Higher security

You may be interested in Unlimited Strength Jurisdiction Policy Files for higher security and ability to use AES-256 cryptography. Please make sure you read the policy statement.

You can download it from here and make sure you unzip these files to <java-home>/jre/lib/security (please make backups as required).

Official Links

Compiling

All the following commands should be run from the root directory.

Compile Library

mkdir bin
sh compile-lib.sh

Compile & Running The Sample Application

sh compile-and-run-sample.sh

Usage

Residue r = Residue.getInstance();
r.loadConfigurations("config.json");
r.reconnect();

Residue.Logger logger = Residue.getInstance().getLogger("default");

logger.info("info log");
logger.verbose(3, "verbose level 3 log");

// you can set System.out print stream

Residue.getInstance().setDefaultLoggerId("sample-app");
System.setOut(Residue.getInstance().getPrintStream());

// all of these calls will send to residue
System.out.println("this is %s", "message");
System.out.println(true);

Samples

Check out simple sample or Android sample

License

Copyright 2017-present @abumq (Majid Q.)

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.

residue-java's People

Contributors

abumq avatar dependabot[bot] avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

waqaskhan540

residue-java's Issues

Support for older android API levels

nio was added to android on API level 26 which is part of Android O (8.0) which is very new and not many phones have adapted them

We need to write another similar class (do not change this) that uses third party asynchronous sockets. This will be an option for old android APIs

Technically this should be in new repo (may be: residue-android and recommend usage of this library for API <= 25 and residue-java for API 26+) but for now we will do it here until we create and estabilish that repository.

Integrate java logger API

Currently Logger class is simple but the intergation to existing projects will become very very smooth if we add a custom handler for java logger API

Exisiting projects can then add this handler in config without having to change all the imports

We can also add custom appender for log4j but we can do it in seperate issue (writing it here to keep note of it)

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.