SimpleLogger

Simple Android logger

License

License

GroupId

GroupId

it.sephiroth.android.library.simplelogger
ArtifactId

ArtifactId

simple-logger
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

SimpleLogger
Simple Android logger
Project URL

Project URL

https://github.com/sephiroth74/SimpleLogger
Source Code Management

Source Code Management

https://github.com/sephiroth74/SimpleLogger

Download simple-logger

How to add to project

<!-- https://jarcasting.com/artifacts/it.sephiroth.android.library.simplelogger/simple-logger/ -->
<dependency>
    <groupId>it.sephiroth.android.library.simplelogger</groupId>
    <artifactId>simple-logger</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/it.sephiroth.android.library.simplelogger/simple-logger/
implementation 'it.sephiroth.android.library.simplelogger:simple-logger:1.0.0'
// https://jarcasting.com/artifacts/it.sephiroth.android.library.simplelogger/simple-logger/
implementation ("it.sephiroth.android.library.simplelogger:simple-logger:1.0.0")
'it.sephiroth.android.library.simplelogger:simple-logger:aar:1.0.0'
<dependency org="it.sephiroth.android.library.simplelogger" name="simple-logger" rev="1.0.0">
  <artifact name="simple-logger" type="aar" />
</dependency>
@Grapes(
@Grab(group='it.sephiroth.android.library.simplelogger', module='simple-logger', version='1.0.0')
)
libraryDependencies += "it.sephiroth.android.library.simplelogger" % "simple-logger" % "1.0.0"
[it.sephiroth.android.library.simplelogger/simple-logger "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.android.support » appcompat-v7 jar 24.2.1

Project Modules

There are no modules declared in this project.

Simple Logger for Android

Build Status Maven Central Download

Installation

In your project's build.gradle file add the following line to the dependencies group:

compile 'it.sephiroth.android.library.simplelogger:simple-logger:1.0.0'

Usage

Usage of the BottomNavigation widget is very easy. Just place it in your layout.xml like this:

LoggerFactory.Logger logger = LoggerFactory.getLogger("MainActivity", LoggerFactory.LoggerType.Console);

// optional, set a minimum filter level
// logger.setLevel(Log.INFO);

logger.info("Info message: %s", "test string");
logger.verbose("Verbose message: %d", 1);
logger.debug("Debug message: %b", false);
logger.error("Error message: %g", 1.5f);
logger.warn("Warning message");
logger.log(new IOException("test io exception"));

You can also use a NullLogger, which won't do anything, for instance to be used for your production release:

LoggerFactory.Logger logger = LoggerFactory.getLogger("Main", BuildConfig.DEBUG ? LoggerType.Console : LoggerTye.Null);

There's also a simple FileLogger included:

LoggerFactory.FileLogger fileLogger = LoggerFactory.getFileLogger("test.log");

// truncate the file
fileLogger.clear();

// level filter
fileLogger.setLevel(Log.INFO);
fileLogger.info("Info message: %s", "test string");
fileLogger.verbose("Verbose message: %d", 1); // won't be logged
fileLogger.debug("Debug message: %b", false); // won't be logged
fileLogger.error("Error message: %g", 1.5f);
fileLogger.warn("Warning message");
fileLogger.log(new IOException("test io exception")); // won't be logged

License

The MIT License (MIT)

Copyright (c) 2016 Alessandro Crugnola

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Versions

Version
1.0.0