MCPcopy Index your code
hub / github.com/JumeiRdGroup/Android-PLog

github.com/JumeiRdGroup/Android-PLog @v2.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.0 ↗ · + Follow
269 symbols 667 edges 37 files 103 documented · 38%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Android-PLog Build Status Download

中文版文档

Summary

PLog is a logging library for Android, which has following features:

Easy to print

  • print without tag
  • print without message
  • accept anny type of arguments
  • accept variable length arguments
  • auto formatting
  • print with builder style code

Controllable output

  • intercept with multi dimension
  • customizable output decoration (style)
  • multi channel output
  • soft wrap supported

Easy to filter

  • global tag (for filtering apps)
  • auto tag (for filtering classes)
  • keep stacktrace (for filtering files and/or methods)
  • category (for filtering developers or groups, etc)

Dependency on demand

You can use plog-core module for simple scenarios, but you can also import other modules for advanced usage. As you like.

Flexible Setting/Extension

You can use built-in options or just a little interface implementation to satisfy almost all your needs.

PLog is a logging library for Android, follows following principle:

Applicability

Focus on log itself, discard divider lines and other complicated decors but still keep being powerful.

Light weight

PLog is zero dependency!

Flexibility and expandability

PLog provides multi configs to fit your custom needs.

Convention over configuration

Although PLog provides init method,your program will still work by using default logging configurations. And you can user Builder class to simply build your own config. Bonus: recommend method maybe help you much!

Usage

Please view Wiki to get usage details and advanced features.

Features

  • Jcenter support, ZERO DEPENDENCY
  • Empty method support (useful for observe somewhere executed )
  • Log without tag/ global tag/ auto tag
  • Varargs support and auto formatting
  • JSON format support
  • Throwable format support
  • Timing log support
  • Line number and stackOffset support
  • Loggable controller with different level
  • Local file logger is available
  • Logger redirect support(useful for adapt a 3-party logging, etc)
  • Very long log content support, either auto line wrap(soft wrap)

Compare With Other Libs

Library Name Logger Timber KLog Android-PLog
Star/Fork 5.7K+/1.0K+ 3.5K+/366 1.1K+/251 Welcome!
Easy To Print
Easy To Use
Flexible Settings
Light Weight ☆☆ ☆☆
Locating in IDE ×
Thread Info × ×
Easy To Filter × ☆☆
Beautify × ☆☆
Controllable and Multi Output × ☆☆ ☆☆

Sample Screen Shot

ScreenShot

Contribution & Contact

Thanks for using PLog, this library is still in active development.Any contribution and suggestions are welcome. Please feel free to contact me by using following way:

Email: muyangmin@foxmail.com

Licence

Copyright 2016-2017 Muyangmin

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.

Extension points exported contracts — how you extend this code

Formatter (Interface)
This interface defines how to format log msg. @since 1.5.0 [8 implementers]
plog/src/main/java/org/mym/plog/Formatter.java
FileNameGenerator (Interface)
The interface to generate new log file. [2 implementers]
plog-printer/src/main/java/org/mym/plog/printer/FilePrinter.java
Interceptor (Interface)
Decide intercept a log, or let it print out. @since 2.0.0-beta2 [5 implementers]
plog/src/main/java/org/mym/plog/Interceptor.java
SoftWrapper (Interface)
Provide soft wrap feature. @since 2.0.0 [4 implementers]
plog/src/main/java/org/mym/plog/SoftWrapper.java
Style (Interface)
This interface and its subclasses defines how logs are decorated. @since 2.0.0 [2 implementers]
plog/src/main/java/org/mym/plog/Style.java
Category (Interface)
Defines a dimension of interception, usually useful for large teams. @since 2.0.0 [2 implementers]
plog/src/main/java/org/mym/plog/Category.java

Core symbols most depended-on inside this repo

print
called by 22
plog/src/main/java/org/mym/plog/Printer.java
level
called by 18
plog/src/main/java/org/mym/plog/PLog.java
format
called by 14
plog/src/main/java/org/mym/plog/Formatter.java
params
called by 13
plog/src/main/java/org/mym/plog/LogRequest.java
equals
called by 11
plog/src/main/java/org/mym/plog/SimpleCategory.java
stackOffset
called by 11
plog/src/main/java/org/mym/plog/LogRequest.java
msg
called by 10
plog/src/main/java/org/mym/plog/LogRequest.java
d
called by 7
plog/src/main/java/org/mym/plog/PLog.java

Shape

Method 223
Class 39
Interface 7

Languages

Java100%

Modules by API surface

app/src/main/java/org/mym/prettylog/MainActivity.java39 symbols
plog/src/main/java/org/mym/plog/config/PLogConfig.java29 symbols
plog/src/main/java/org/mym/plog/PLog.java22 symbols
plog-printer/src/main/java/org/mym/plog/printer/FilePrinter.java21 symbols
plog/src/main/java/org/mym/plog/LogRequest.java19 symbols
plog/src/main/java/org/mym/plog/LogEngine.java14 symbols
plog/src/main/java/org/mym/plog/AbsPrinter.java12 symbols
plog-formatter/src/main/java/org/mym/plog/formatter/DefaultFormatter.java11 symbols
app/src/main/java/org/mym/prettylog/CrashPrinter.java8 symbols
plog-lint/src/main/java/org/mym/plog/lint/LoggingIssueDetector.java7 symbols
app/src/main/java/org/mym/prettylog/TextViewPrinter.java7 symbols
plog/src/main/java/org/mym/plog/SimpleCategory.java6 symbols

For agents

$ claude mcp add Android-PLog \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact