Logger

Additional

Language
Java
Version
1.0.3 (Oct 9, 2015)
Created
Oct 9, 2015
Updated
Oct 10, 2015 (Retired)
Owner
John Doe (ablack13)
Contributor
John Doe (ablack13)
1
Activity
Badge
Generate
Download
Source code

Logger

Simple logger for Android with support sections and json representation in the original form (only working with DEBUG logs)

Setup

Copy ```Logger.java``` from ```/code/``` folder to your project and fix package

Quick start:

With tag and message

Logger.d("SampleActivity","Simple logs");

With section and message

In this case, first argument used for a section label ```java Logger.dd("Simple section", "Simple log text"); ``` ![](https://cloud.githubusercontent.com/assets/5351890/10395472/dbe00db8-6ea5-11e5-8c67-0a71590eeade.png) ===

With section and JSON

If message contains JSON syntax, that json be represent in the original form ```java Logger.dd("Logs with json", "{"key1":"value1","key2":"value2","key3":"value3","key4":{"key5":"value5"}}"); ``` ![](https://cloud.githubusercontent.com/assets/5351890/10395463/ce072910-6ea5-11e5-9c9c-f2893e8409ce.png) ===

Without tag

In this case for first argument will be use class name that called ```Logger.d("test example 1")``` Log message start with called method's name as prefix ```java Logger.d("test example 1"); ``` ![](https://cloud.githubusercontent.com/assets/5351890/10400607/656fbdb4-6ec2-11e5-9f46-5e9b6754ac61.png)

intercept() - method were was called Logger.d("test example 1") from LoggerInterceptorImpl class

Log's color

For change logs color: http://stackoverflow.com/questions/19933731/colored-logcat-in-android-studio-by-colorpid

License

Copyright 2015 A.Prayzner

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.