How to disable Debug Message

1,769 views
Skip to first unread message

Ferry Fadly

unread,
Dec 1, 2010, 1:50:30 AM12/1/10
to ORMLite Users
any one know how to turn off debug message ?? since its not use log4j
library I worried this message make slow down the application if
execute lots of query transaction.

Gray Watson

unread,
Dec 1, 2010, 10:38:59 AM12/1/10
to ormlit...@googlegroups.com

It does use log4j if it is available and is very efficient at not generating log messages if debug is not enabled. It's got an internal slf4j implementation. If you are using the LocalLog implementation then you can change the log level with a property.

Here's information from LocalLog header. I need to add this to the manual.

* You can set the log level by setting the System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "trace"). Acceptable
* values are: TRACE, DEBUG, INFO, WARN, ERROR, and FATAL. You can also redirect the log to a file by setting the
* System.setProperty(LocalLog.LOCAL_LOG_FILE_PROPERTY, "log.out"). Otherwise, log output will go to stdout.

What are you seeing Ferry to make you worried?
gray

Message has been deleted

Pablo Distéfano

unread,
May 17, 2013, 9:18:09 AM5/17/13
to ormlit...@googlegroups.com
Hi, is there a way to disable the logging using the AndroidLog implementation?
I'm seeing a lot of create table log lines of the TableUtils class and I want to remove them from my release version.
Thanks,

Gray Watson

unread,
May 17, 2013, 9:33:18 AM5/17/13
to ormlit...@googlegroups.com
On May 17, 2013, at 9:18 AM, Pablo Distéfano <pablo...@gmail.com> wrote:

> Hi, is there a way to disable the logging using the AndroidLog implementation?
> I'm seeing a lot of create table log lines of the TableUtils class and I want to remove them from my release version.

I believe this page should be helpful:

http://stackoverflow.com/questions/2018263/android-logging

The 2nd answer says:

You can specify them in the file '/data/local.prop' as follows:

log.tag.MyAppTag=WARN

So I guess that the following should work to only show ORMLite warn messages:

log.tag.ORMLite=WARN

For Android logging you should RTFM here:

http://ormlite.com/docs/android-logging

gray

Carl

unread,
Mar 26, 2014, 8:39:00 AM3/26/14
to ormlit...@googlegroups.com


On Friday, May 17, 2013 3:33:18 PM UTC+2, Gray wrote:


For Android logging you should RTFM here:

        http://ormlite.com/docs/android-logging

gray

At the moment, I want to hide those:
03-26 13:33:02.620: I/DaoManager(2378): Loaded configuration for class rainstudios.kelo.data.model.User
03-26 13:33:02.620: I/DaoManager(2378): Loaded configuration for class rainstudios.kelo.data.model.Image
...
03-26 13:33:02.940: I/TableUtils(2378): creating table 'cacheentry'
03-26 13:33:02.960: I/TableUtils(2378): executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS `cacheentry` (`cacheKey` VARCHAR , `resultClassName` VARCHAR , `resultIdByte` TINYINT , `resultIdChar` CHAR , `resultIdDouble` DOUBLE PRECISION , `resultIdFloat` FLOAT , `resultIdInteger` INTEGER , `resultIdLong` BIGINT , `resultIdShort` SMALLINT , `resultIdString` VARCHAR , `timestamp` BIGINT , PRIMARY KEY (`cacheKey`) )
03-26 13:33:02.976: I/TableUtils(2378): creating table 'image'
...

I tried to disable the info logging in my android app code with this code executed in my MyApplication.onCreate() :

        value = String.valueOf(android.util.Log.WARN);
        System.setProperty("log.tag.ORMLite", value);
        System.setProperty("log.tag.StatementExecutor", value);
        System.setProperty("log.tag.BaseMappedStatement", value);
        System.setProperty("log.tag.MappedCreate", value);

        System.setProperty("log.tag.droidDatabaseConnection", value);
        System.setProperty("log.tag.droidDatabaseConnection", value);
        System.setProperty("log.tag.ndroidCompiledStatement", value);
        System.setProperty("log.tag.AndroidDatabaseConnection", value);
        System.setProperty("log.tag.AnddroidDatabaseConnection", value);
        System.setProperty("log.tag.AndroidCompiledStatement", value);

        System.setProperty("log.tag.DaoManager", value);
        System.setProperty("log.tag.TableUtils", value);

 I do understand that my issue can be related to a gross misunderstanding of how Android logging (and Ormlite logging) works
but maybe someone has solved that issue already.

Any idea what am I doing wrong?
Reply all
Reply to author
Forward
0 new messages