Re: [blrdroid] Discussion on Logger(s)

From: user 7.
Sent on: Tuesday, September 17, 2013 6:35 AM
Great minds think alike :-)

For simple logcat logging, use Logger calls.
For writing to a file, you need to initialize LogFile first.

I tested writing to a file in app_data but i need to fix the SD card writing.  (SD card writing needs to handle more exception cases - devices that don't have SD card, or devices where the SD card is currently read only)

Gaurav


On Tue, Sep 17, 2013 at 12:48 AM, Ravi Vyas <[address removed]> wrote:
Here is a logging framework I had literally assembled form various answers on Stackoverflow 2 years ago :https://github.com/ravivyas84/SimpleLoggingFramework

I had to decompile some of my own APKs to get the code as I lost the original sourcecode, logging works and is tested, need to test the writing to file part as the code is more than 2 years old now.

Regards,
Ravi Vyas

"Judge a man by his questions rather than by his answers" - Voltaire  



On Mon, Sep 16, 2013 at 1:13 PM, Gaurav Lochan <[address removed]> wrote:
Aman - 

I've played around with Log4J and slf4j.  I've found both of them heavier for android than they need to be.  That's because they're designed to be general purpose loggers and are extremely useful in the enterprise/desktop world, where you can configure them (in xml) for different types of outputs (local file, rollover file, remote file, etc).  SLF4J is from the guy who initially wrote Log4J, and is trying to solve some problems in Log4J.

Specifically, on android:
- Log4J doesn't work out of the box, and you need an additional library to use it on android.  That itself turned me away.
- SLF4J looks lighter than Log4J.  You can call the API, and also hook it up to a SimpleLogger for logging to a file, and the AndroidLogger for logging to logcat.  My concern is that it's slf4j is solving a different use case than what most android devs care about.  

I wrote a very simple logger for android a couple of years ago to solve the basic problem of changing log levels prior to release (mentioned it at droidcon 2012).  I've been meaning to add the capability to log to a local file, and to support uploading the logfile (for instance, if customer support is helping the customer with a bug).  I was planning to make this open source because i've seen too many developers do the same thing (or worse, comment out logs prior to release!).  How soon were you planning to use this?

Thanks,

Gaurav





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Gaurav Lochan ([address removed]) from The Bangalore Android User Group - [ B.A.U.G ].
To learn more about Gaurav Lochan, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Ravi Vyas ([address removed]) from The Bangalore Android User Group - [ B.A.U.G ].
To learn more about Ravi Vyas, visit his/her member profile

Our Sponsors

  • Though Works

    Location Sponsor

  • GTUG

    Sponsor

  • Yourstory.in

    Media Partner

  • Startup Weekend

    Community Partner

  • Yahoo

    Location Sponsor

  • Intel

    Location Sponsor

  • Apigee

    Location Sponsor

  • Intuit

    Location Sponsor

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy