How do i see a log of all the queries that have been executed in my app? im using classic eclipse. in the logcat i cant see any queries that have occurred while my app has been running.
Where do i see this? ive looked at the log and i do not see any queries or anything in there...
Any help would be greatly appreciated.
Queries are not logged automatically. You will need to manually log them with calls to Log.d() etc.
I'm not sure if there is a way to see queries performed by your application automatically, but it would probably be a good idea to use the Log class and write debug log entries when you perform a query, so that they get registered there, with a tag defined by you which you can use to easily filter these messages in the log cat console.
Related
I've just started work with Koltin and my question might be a little strange to someone who have more experience,
but how can i see fatalExceptions in logcat? For example, i have an app that is already developed by another dev,
there is an error in one activity - after pressing the button apps crash and restart to main activity.
I don't see any usefull informations in logcat(in fabric also!), moving on trough whole code from listener to fragment and many classess is very time consuming. There must be some way to figure it out quicker, right?
Exceptions should be shown/thrown in logcat, same as with Java.
If the exception is thown within rxjava or a kotlin coroutine, make sure you have defined an error handler, otherwise the exception might get swallowed.
Then make sure you have selected the right app in logcat and that no filter is active.
Also make sure there is no other global Exception handler defined besides fabric.
I have a lot of output in my logcat (Android Monitor) which in which I would like to find a specific part. This part starts with a keyword, which is followed by several logs with information I want to check.
I know there is the possibilty to filter the logcat by the Log level and searching for expressions. When I type the keyword in the UI only the logs are filtered by the keyword.
I am interessted in the lines/logs which are followed by the keyword. Is there a search option, where no information is filtered and the results are shown in the complete log?
Commands proposed in this answer like Ctrl+s do not work.
a while ago I had the same problem and created a Logger helper class which help me by tagging the android logs automatically with the line_number, ClassName and Method name via reflection, this had helped me a lot, for example when I just want to filter the output of a method I write the name of the method in the logcat filter and it just gives me all logs inside that method, same with line numbers and Classes, try it out I have made a gist with it.
To use it is easy just do Logger.getLogger and assign to some easy name like log then log like normally just log.d("string") without the tag and it automatically takes the line method and class, It has good documentation on it so you might be able to tweak it if you want, hope it helps.
How do I access call log for android?
found this but this gives me an access to my existing call log. I want to make private call log in which some specified numbers will be handled.
A "private call log" is simply a list (or ListView activity).
You can use the same layouts and fonts as the "default" android app, but remember that each carrier and manufacturer re-brands the call logs on almost every phone.
So you just need to make your own. You can monitor call logs and remove them if you don't want them duplicated in both logs. See this post:
Delete call log in android for particular number
I have a Log class, i can use it to log every thing from every class to write on a single file..
This works fine.
But i have a lot of async task on my programme and i can have concurence acces to my log class and file how can i protect it to don't have split Log message or error?
Cause if two Asynctasks need to log something at the same time i don't know how this works.
I don't know if it's a good idea to log in the same file with multiple thread.
Is concurencial acces to file manage by android or need i to dev some thread lock with mutex like in C?
When two or more threads need access to a shared resource, they need some way to ensure that the resource will be used by only one thread at a time.
The process by which this synchronization is achieved is called thread synchronization.
Check out Java synchronization tutorial here.
Add synchronized keyword to your logging function
What is the usual way on Android to stop my application if it has reached an unrecoverable error.
finish() will not do it, since it wont stop any running services or threads. Furthermore I would like to inform the user what has happend and please him to send an error log.
As far as I googled, it seems like there is no way to close my application and open a special crashreport activity or something else to show the user whats going on or send a crash log.
I think you should throw unhandled runtime exception. In such case android will kill all your process. Also I suggest you to use ACRA. This library will help you to get crash report (via email, google docs, etс.) and it can show customizable error dialog to a user.
You should check this out. This could be your solution.
ACRA
Check the basic setup guide to start using the library. ACRA - Basic Setup
While ACRA is an okay solution, if you want to implement your own logging of unhandled exceptions try Thread.setDefaultUncaughtExceptionHandler(). That way you can get any exceptions that are thrown and not caught, and log them the way you like. You need to implement Thread.UncaughtExceptionHandler and pass it to that method.
With an Activity, it would look something like this in onCreate():
getMainLooper().getThread().setUncaughtExceptionHandler(new MyUncaughtExceptionHandler());