AngersZhuuuu commented on a change in pull request #26340: [WIP][SPARK-29108][SQL] Add new module sql/thriftserver with all code and UT URL: https://github.com/apache/spark/pull/26340#discussion_r341196944
########## File path: sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala ########## @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.utils + +import java.io.PrintStream + +import org.apache.commons.lang.StringUtils +import org.apache.hadoop.hive.ql.session.SessionState +import org.slf4j.Logger + + +/** + * This class provides helper routines to emit informational and error + * messages to the user and log4j files while obeying the current session's + * verbosity levels. + * + * NEVER write directly to the SessionStates standard output other than to + * emit result data DO use printInfo and printError provided by LogHelper to + * emit non result data strings. + * + * It is perfectly acceptable to have global static LogHelper objects (for + * example - once per module) LogHelper always emits info/error to current + * session as required. + */ +private[thriftserver] object LogHelper { Review comment: > do we need this? > the scala code just uses spark Logging. Could the java code also have some adapter to use spark logging? SparkSQLCLI's code need this and it's different in hive 1.2.1/2.3.4 So I implement a class here. We can decide where we need this later. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
