Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afiqiqmal/EzyLogger
Simple Logger for Android
https://github.com/afiqiqmal/EzyLogger
android listing log logger toast
Last synced: about 2 months ago
JSON representation
Simple Logger for Android
- Host: GitHub
- URL: https://github.com/afiqiqmal/EzyLogger
- Owner: afiqiqmal
- License: gpl-3.0
- Created: 2017-01-20T01:43:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-09-08T03:05:17.000Z (over 4 years ago)
- Last Synced: 2024-12-03T15:50:49.738Z (about 2 months ago)
- Topics: android, listing, log, logger, toast
- Language: Java
- Size: 119 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-android - EzyLogger - Simple Lightweight logger (Libraries / Logger)
- awesome-android-libraries - EzyLogger
- awesome-android - EzyLogger - Simple Lightweight logger (Libraries / Logger)
README
# EzyLogger-Android
Simple Logger for Android[![](https://jitpack.io/v/afiqiqmal/EzyLogger.svg)](https://jitpack.io/#afiqiqmal/EzyLogger)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/paypalme/mhi9388?locale.x=en_US)### Gradle
```grovvy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}dependencies {
compile 'com.github.afiqiqmal:EzyLogger:1.1.0'
}
```### Maven
```grovvycom.github.afiqiqmal
EzyLogger
1.1.0```
[![](https://s2.postimg.org/p1t1p1ebd/Screen_Shot_2017-04-20_at_11.53.28_AM.png)](http://www.methodscount.com/?lib=com.github.afiqiqmal%3AEzyLogger%3A1.1.0)
### How to use:
Init Logger
Use in Activity
```javapublic class BaseActivtiy extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//inline initialize
new Logger.Builder(this).setTag("testing").enableLog(true).create();//short initialize
Logger.init(this); // Optional if you dont use Logger Toast
Logger.initTag(this,"testing"); // default is 'EzyLogger'
Logger.initTag("testing"); // default is 'EzyLogger'
Logger.canShowLog(true); // default is True
}
}```
Logger use
```java//info log
Logger.info(TAG,"message"); // can set TAG here if not using initTag
Logger.info("message");
Logger.info(Object);
Logger.info(Object,Format); // JSON, XML,LIST, MAP, BUNDLE, STRING, INTENT, ARRAYLogger.debug(...);
Logger.warn(...);
Logger.error(...);
Logger.verbose(...);
Logger.wtf(...);//EXAMPLE OF USE
List> users = new ArrayList<>();
Bundle bundle = new Bundle();
Map map = new LinkedHashMap<>();
Intent intent = new Intent();Logger.info("message");
Logger.info(0);
Logger.info(new String[]{"test","world","hello"});
Logger.info(new int[]{0,1,2,3,4});
Logger.info(true);Logger.info(users);
Logger.info(bundle);
Logger.info(map);
Logger.info(intent);Logger.info(JSON_STRING,Format.JSON);
Logger.info(XML_STRING,Format.XML);
Logger.info(users,Format.LIST);
Logger.info(bundle,Format.BUNDLE);
Logger.info(map,Format.MAP);
Logger.info(intent,Format.INTENT);
Logger.info("message",Format.STRING);
Logger.info(new String[]{"array","1","2"},Format.ARRAY);
```Use Logger for showing Toast
``` java
// Logger.init(this) is needed
Logger.shortToast(MESSAGE);
Logger.longToast(MESSAGE);
```Extra Logger
if you need to list all the values in SharedPreferences
```java//init
Logger.init(this) //needed if not init yet//will log all the prefs in the default Prefs
new Logger.Preference().printAllSharedPref();//log all the prefs in the selected Prefs
new Logger.Preference().whichPrefDBName(PREF_NAME).printAllSharedPref();//log the value by the key
new Logger.Preference().printSharedPrefByKey(KEY);//OR can do like this
Logger.Preference pref = new Logger.Preference();
pref.whichPrefDBName(PREF_NAME);
pref.printAllSharedPref();
pref.printSharedPrefByKey(KEY);```
###License
Copyright 2017 HAFIQ IQMALLicensed 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 athttp://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.