All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.huaweicloud.dws.client.util.LogUtil Maven / Gradle / Ivy

There is a newer version: 2.0.0-r0
Show newest version
package com.huaweicloud.dws.client.util;

import com.huaweicloud.dws.client.DwsConfig;
import com.huaweicloud.dws.client.model.TableName;

/**
 * @ProjectName: dws-connector
 * @ClassName: LogUtil
 * @Description:
 * @Date: 2023/2/8 10:53
 * @Version: 1.0
 */
public class LogUtil {

    public static void withLogSwitch(DwsConfig config, LogFunction function) {
        if (config.isLogSwitch()) {
            function.log();
        }
    }

    public static void withLogData(DwsConfig config, TableName tableName, LogFunction function) {
        if (config.getLogDataTables() != null && config.getLogDataTables().contains(tableName)) {
            function.log();
        }
    }

    public static interface LogFunction {
        void log();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy