From 9b4433fddf5b401edb0aace8a404ac733b122702 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期四, 03 四月 2025 14:35:02 +0800
Subject: [PATCH] 添加非密字段显示

---
 Source/BladeX-Tool/blade-core-launch/src/main/java/org/springblade/core/launch/log/BladeLogLevel.java |  114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 114 insertions(+), 0 deletions(-)

diff --git a/Source/BladeX-Tool/blade-core-launch/src/main/java/org/springblade/core/launch/log/BladeLogLevel.java b/Source/BladeX-Tool/blade-core-launch/src/main/java/org/springblade/core/launch/log/BladeLogLevel.java
new file mode 100644
index 0000000..4bc26ea
--- /dev/null
+++ b/Source/BladeX-Tool/blade-core-launch/src/main/java/org/springblade/core/launch/log/BladeLogLevel.java
@@ -0,0 +1,114 @@
+/*
+ *      Copyright (c) 2018-2028, DreamLu All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: DreamLu 鍗㈡槬姊� (596392912@qq.com)
+ */
+
+package org.springblade.core.launch.log;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * 璇锋眰鏃ュ織绾у埆锛屾潵婧� okHttp
+ *
+ * @author L.cm
+ */
+@Getter
+@RequiredArgsConstructor
+public enum BladeLogLevel {
+	/**
+	 * No logs.
+	 */
+	NONE(0),
+
+	/**
+	 * Logs request and response lines.
+	 *
+	 * <p>Example:
+	 * <pre>{@code
+	 * --> POST /greeting http/1.1 (3-byte body)
+	 *
+	 * <-- 200 OK (22ms, 6-byte body)
+	 * }</pre>
+	 */
+	BASIC(1),
+
+	/**
+	 * Logs request and response lines and their respective headers.
+	 *
+	 * <p>Example:
+	 * <pre>{@code
+	 * --> POST /greeting http/1.1
+	 * Host: example.com
+	 * Content-Type: plain/text
+	 * Content-Length: 3
+	 * --> END POST
+	 *
+	 * <-- 200 OK (22ms)
+	 * Content-Type: plain/text
+	 * Content-Length: 6
+	 * <-- END HTTP
+	 * }</pre>
+	 */
+	HEADERS(2),
+
+	/**
+	 * Logs request and response lines and their respective headers and bodies (if present).
+	 *
+	 * <p>Example:
+	 * <pre>{@code
+	 * --> POST /greeting http/1.1
+	 * Host: example.com
+	 * Content-Type: plain/text
+	 * Content-Length: 3
+	 *
+	 * Hi?
+	 * --> END POST
+	 *
+	 * <-- 200 OK (22ms)
+	 * Content-Type: plain/text
+	 * Content-Length: 6
+	 *
+	 * Hello!
+	 * <-- END HTTP
+	 * }</pre>
+	 */
+	BODY(3);
+
+	/**
+	 * 璇锋眰鏃ュ織閰嶇疆鍓嶇紑
+	 */
+	public static final String REQ_LOG_PROPS_PREFIX = "blade.log.request";
+	/**
+	 * 鎺у埗鍙版棩蹇楁槸鍚﹀惎鐢�
+	 */
+	public static final String CONSOLE_LOG_ENABLED_PROP = "blade.log.console.enabled";
+
+	/**
+	 * 绾у埆
+	 */
+	private final int level;
+
+	/**
+	 * 褰撳墠鐗堟湰 灏忎簬鍜岀瓑浜� 姣旇緝鐨勭増鏈�
+	 *
+	 * @param level LogLevel
+	 * @return 鏄惁灏忎簬鍜岀瓑浜�
+	 */
+	public boolean lte(BladeLogLevel level) {
+		return this.level <= level.level;
+	}
+
+}

--
Gitblit v1.9.3