Timber SQL Logger


Source link: https://github.com/explodes/android-sql-logging

Timber SQL Logger

Log to a sql database for debugging. View the logs in-app with the LogViewerActivity.

This library was created when I decided that having my phone attached to logcat for hours in hopes a heisenbug would appear in a service was too inefficient.

Works with API level 11+

Usage

Logging is done manually by wait of...

 LogEntry entry = LogEntry.createLogEntry(Log.DEBUG, TAG, "Hit critical function");

  LogEntryProvider.insertLogEntry(context, entry);

...or you can plant a tree with Timber using SQLLoggingTree:

public class App extends Application {

// The default tag is used when no tag is provided.  private static final String DEFAULT_TAG = "TimberSqlSampleApp";
@Override  public void onCreate() {

LogEntryProvider.initialize(this);

Timber.plant(new SqlLoggingTree(this, DEFAULT_TAG));
  
}
 
}

Setup

In your app's AndroidManifest, you will need to include two items:

<activity
  android:name="io.explod.android.sqllog.ui.activity.LogViewerActivity"
  android:exported="false"/>  <!-- Important: set your own authority name and provide that name in the metadata -->  <provider
  android:name="io.explod.android.sqllog.data.LogEntryProvider"
  android:authorities="your.authority.name"
  android:exported="false"/>  <meta-data android:name="io.explod.sqllog.log.authority" android:value="your.authority.name"/>

And finally, to view the logs, you start the activity:

 private void goToLogViewer() {

Intent intent = new Intent(this, LogViewerActivity.class);

startActivity(intent);
  
}

License

Copyright 2016 Evan Leis  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. 

Resources

A library to display videos in a TextureView using a custom MediaPlayer controller.

Custom implementation of the Floating Label pattern.

MultiSelectRecyclerGalleryGridView is a custom sample application which displays the Gallery images from the device in a more organised manner by displaying images in a categorized manner and enables the MultiSelect feature to pick and share the images through various sharing options.

IconColorChanger is a custom implementation in which icons with white colors can be transformed into different colors using hex color codes.

MaterialCircleProgressBar is a custom implementation of ProgressBar dialog as similar to SwipeRefreshLayout loader. It could be used as an alternative for normal ProgressBar in android.

SpannableTextView allows to customize the styles for a single TextView (i.e., styles, size, color) rather create a separate layout.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes