com.j256.ormlite.logger.LocalLog Java Examples

The following examples show how to use com.j256.ormlite.logger.LocalLog. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Database.java    From PacketProxy with Apache License 2.0 6 votes vote down vote up
private void createDB() throws Exception
{
	PacketProxyUtility util = PacketProxyUtility.getInstance();
	if (! Files.exists(databaseDir)) {
		util.packetProxyLog(databaseDir.toAbsolutePath() + " directory is not found...");
		util.packetProxyLog("creating the directory...");
		Files.createDirectories(databaseDir);
		System.out.println("success!");
	} else {
		if (! Files.isDirectory(databaseDir)) {
			util.packetProxyLogErr(databaseDir.toAbsolutePath() + " file is not directory...");
			util.packetProxyLogErr("Must be a directory");
			System.exit(1);
		}
	}

	System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "error");
	source = new JdbcConnectionSource(getDatabaseURL());
	DatabaseConnection conn = source.getReadWriteConnection();
	conn.executeStatement("pragma auto_vacuum = full", DatabaseConnection.DEFAULT_RESULT_FLAGS);
}
 
Example #2
Source File: ShadowsocksApplication.java    From ShadowsocksRR with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    app = this;
    // init toast utils
    ToastUtils.init(getApplicationContext());
    initVariable();

    if (!BuildConfig.DEBUG) {
        java.lang.System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "ERROR");
    }
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
    checkChineseLocale(getResources().getConfiguration());
    TagManager tm = TagManager.getInstance(this);
    PendingResult<ContainerHolder> pending = tm.loadContainerPreferNonDefault("GTM-NT8WS8", R.raw.gtm_default_container);
    ResultCallback<ContainerHolder> callback = new ResultCallback<ContainerHolder>() {
        @Override
        public void onResult(@NonNull ContainerHolder holder) {
            if (!holder.getStatus().isSuccess()) {
                return;
            }
            containerHolder = holder;
            Container container = holder.getContainer();
            container.registerFunctionCallMacroCallback(SIG_FUNC, new Container.FunctionCallMacroCallback() {
                @Override
                public Object getValue(String functionName, Map<String, Object> parameters) {
                    if (SIG_FUNC.equals(functionName)) {
                        return Utils.getSignature(getApplicationContext());
                    } else {
                        return null;
                    }
                }
            });
        }
    };
    pending.setResultCallback(callback, 2, TimeUnit.SECONDS);
    JobManager.create(this).addJobCreator(new DonaldTrump());

    if (settings.getBoolean(Constants.Key.tfo, false) && TcpFastOpen.supported()) {
        mThreadPool.execute(new Runnable() {
            @Override
            public void run() {
                TcpFastOpen.enabled(settings.getBoolean(Constants.Key.tfo, false));
            }
        });
    }
}
 
Example #3
Source File: ShadowsocksApplication.java    From Maying with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    app = this;
    // init toast utils
    ToastUtils.init(getApplicationContext());
    initVariable();

    if (!BuildConfig.DEBUG) {
        java.lang.System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "ERROR");
    }
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
    checkChineseLocale(getResources().getConfiguration());
    TagManager tm = TagManager.getInstance(this);
    PendingResult<ContainerHolder> pending = tm.loadContainerPreferNonDefault("GTM-NT8WS8", R.raw.gtm_default_container);
    ResultCallback<ContainerHolder> callback = new ResultCallback<ContainerHolder>() {
        @Override
        public void onResult(@NonNull ContainerHolder holder) {
            if (!holder.getStatus().isSuccess()) {
                return;
            }
            containerHolder = holder;
            Container container = holder.getContainer();
            container.registerFunctionCallMacroCallback(SIG_FUNC, new Container.FunctionCallMacroCallback() {
                @Override
                public Object getValue(String functionName, Map<String, Object> parameters) {
                    if (SIG_FUNC.equals(functionName)) {
                        return Utils.getSignature(getApplicationContext());
                    } else {
                        return null;
                    }
                }
            });
        }
    };
    pending.setResultCallback(callback, 2, TimeUnit.SECONDS);
    JobManager.create(this).addJobCreator(new DonaldTrump());

    if (settings.getBoolean(Constants.Key.tfo, false) && TcpFastOpen.supported()) {
        mThreadPool.execute(new Runnable() {
            @Override
            public void run() {
                TcpFastOpen.enabled(settings.getBoolean(Constants.Key.tfo, false));
            }
        });
    }
}
 
Example #4
Source File: DatabaseHelper.java    From AndroidBase with Apache License 2.0 4 votes vote down vote up
private DatabaseHelper(Context context) {
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
    System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "FATAL");
}