Comments (6)
Hello,
Unfortunately, android-logger library doesn't support dynamic tag changing.
I suggest you using my fork of LOGBack library: https://github.com/noveogroup/logback-android
You can download it here: https://github.com/noveogroup/android-logger/blob/gh-downloads/logback-android-1.0.10-3-SNAPSHOT-android-logger.jar?raw=true
For more information look at the beggining of description of android-logger: https://github.com/noveogroup/android-logger/blob/master/README.md
LOGBack has a lot of useful settings including configurable tags you need. My fork of this library contains simple adapter ch.qos.logback.classic.android.Log that can be used as standard Android logger but without tag parameter - it will get the tag from the configuration as you described.
The configuration you need is (place it in manifest file):
<logback>
<configuration>
<appender
name="LOGCAT"
class="ch.qos.logback.classic.android.LogcatAppender" >
<tagEncoder>
<pattern>%logger{0}</pattern>
</tagEncoder>
<encoder>
<pattern>%msg%n</pattern>
</encoder>
</appender>
<root level="WARN" >
<appender-ref ref="LOGCAT" />
</root>
</configuration>
</logback>
I hope it helps you :)
from android-logger.
I would rather not add a large library for something as simple as logging with a configuration file. This was the original reason why I choose to use android-logger vs many others. I've built the functionality, see [https://github.com/jromero/android-logger/commit/c5cca70c8626acfa6945d0fb73bc466d3bf456a4]. I've also updated the sample branch [https://github.com/jromero/android-logger/commit/da316b6f5313978b95ecfe9bff6a58f8c8c85a32].
I think it would be beneficial to continue development of this particular library vs moving on to logback. I can make a pull request if you wish to continue maintaining it or otherwise I can rebrand and maintain it myself.
from android-logger.
I'm developing new version of android-logger with tag & message formatting support but last months I was in "vacation".
May I publish a link to your fork until I do new version ?
from android-logger.
By the way, thank you for the interest. It inspires :)
from android-logger.
You can definitely link to my fork. Also, if I may suggest renaming the library to something more unique only so that it can more easily be searched for or suggested in conversation. If you search for android logger it's not really among the top answers but the built in android Log/Logger class. Keep up the good work. Can't wait for later releases.
from android-logger.
The new release 1.3.0 is done :)
from android-logger.
Related Issues (20)
- try Gradle build configuration HOT 1
- configuration in manifest, resources, assets, etc. ???
- Logging into file HOT 3
- fast switch between debug and release logger configurations HOT 1
- add special constant or class to access to debug logger with name "XXX" or something similar ...
- Configuration API HOT 1
- Add isEnabled methods HOT 3
- Stack trace ignored HOT 1
- Can you share some screenshots of the app ui, like for the main screen HOT 3
- properties file location HOT 3
- How to disable the log level HOT 9
- where to put the file android-logger.properties? HOT 2
- Cannot log content with "%" symbol. HOT 4
- tag from classname HOT 1
- App crash due to format exception HOT 1
- Parametrize logging statement in presence of a Throwable HOT 1
- Patterns with {sign count} does not work HOT 2
- %caller and %source do not work properly with slf4j
- There is an exception
- Duplicate entry for slf4j class - StaticLoggerBinder HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-logger.