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

wee0.log.ILogContext Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2016-2022, wee0.com.
 *
 * Licensed 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 wee0.log;

/**
 * 日志上下文数据交换空间。
 * @author		baihw
 * @date 		2018年3月16日
 **/

/**
 * 
 *  examples:
 * 
**/ public interface ILogContext{ /** * 请求唯一标识。 */ String KEY_REQ_ID = "req_id"; /** * 请求用户 */ String KEY_REQ_USER = "req_user"; /** * 请求IP */ String KEY_REQ_IP = "req_ip"; /** * 请求设备 */ String KEY_REQ_DEVICE = "req_device"; /** * 设置数据 * * @param key 键名 * @param val 键值 * @return 当前对象,方便链式调用。 */ ILogContext set( String key, String val ); /** * 获取数据 * * @param key 键名 * @param defVal 不存在时的默认值 * @return 数据值 */ String get( String key, String defVal ); /** * 移除指定键名数据。 * * @param key 键名 * @return 当前对象,方便链式调用。 */ ILogContext remove( String key ); /** * 清除数据 */ void clear(); } // end class




© 2015 - 2025 Weber Informatics LLC | Privacy Policy