From 293e7b5cef5892d7be678cdcfe124969e5151087 Mon Sep 17 00:00:00 2001 From: logonkhi Date: Tue, 11 Nov 2025 13:51:23 +0900 Subject: [PATCH] =?UTF-8?q?webgl=20=EB=B9=8C=EB=93=9C=20=EC=8B=9C=20log4ne?= =?UTF-8?q?t=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Plugins/log4uni_1.2.2/log4net.dll.meta | 56 ++++++++++++++++++- Assets/Plugins/log4uni_1.2.2/log4uni.dll.meta | 56 ++++++++++++++++++- Assets/Plugins/sqlite3.dll.meta | 12 ++-- Assets/Scripts/SampleProject/AppMain.cs | 5 +- Assets/Scripts/Simulator/SimulatorAppMain.cs | 4 +- .../UVC/Log/Log4netCodeConfigurator.cs | 4 +- Assets/Scripts/UVC/Log/SQLiteAppender.cs | 5 +- Assets/Scripts/UVC/Log/ULog.cs | 34 ++++++++++- ...niversalRenderPipelineGlobalSettings.asset | 48 ++++++++-------- 9 files changed, 183 insertions(+), 41 deletions(-) diff --git a/Assets/Plugins/log4uni_1.2.2/log4net.dll.meta b/Assets/Plugins/log4uni_1.2.2/log4net.dll.meta index 5a24656d..bc5ab756 100644 --- a/Assets/Plugins/log4uni_1.2.2/log4net.dll.meta +++ b/Assets/Plugins/log4uni_1.2.2/log4net.dll.meta @@ -1,2 +1,56 @@ fileFormatVersion: 2 -guid: ffda049d4c0ac8944953e736728028af \ No newline at end of file +guid: ffda049d4c0ac8944953e736728028af +PluginImporter: + externalObjects: {} + serializedVersion: 3 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + Any: + enabled: 0 + settings: + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude WebGL: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 0 + Editor: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: AnyCPU + DontProcess: false + PlaceholderPath: + SDK: AnySDK + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/log4uni_1.2.2/log4uni.dll.meta b/Assets/Plugins/log4uni_1.2.2/log4uni.dll.meta index ec7a85dd..56fc4bed 100644 --- a/Assets/Plugins/log4uni_1.2.2/log4uni.dll.meta +++ b/Assets/Plugins/log4uni_1.2.2/log4uni.dll.meta @@ -1,2 +1,56 @@ fileFormatVersion: 2 -guid: 8fc9fb3fde8b09e40afdd6740a270db4 \ No newline at end of file +guid: 8fc9fb3fde8b09e40afdd6740a270db4 +PluginImporter: + externalObjects: {} + serializedVersion: 3 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + Any: + enabled: 0 + settings: + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude WebGL: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 0 + Editor: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: AnyCPU + DontProcess: false + PlaceholderPath: + SDK: AnySDK + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/sqlite3.dll.meta b/Assets/Plugins/sqlite3.dll.meta index 89297350..90e7c8b3 100644 --- a/Assets/Plugins/sqlite3.dll.meta +++ b/Assets/Plugins/sqlite3.dll.meta @@ -12,21 +12,21 @@ PluginImporter: validateReferences: 1 platformData: Any: - enabled: 1 + enabled: 0 settings: Exclude Editor: 0 Exclude Linux64: 1 Exclude OSXUniversal: 1 - Exclude WebGL: 0 + Exclude WebGL: 1 Exclude Win: 0 Exclude Win64: 0 - Exclude WindowsStoreApps: 0 + Exclude WindowsStoreApps: 1 Editor: enabled: 1 settings: CPU: x86_64 DefaultValueInitialized: true - OS: AnyOS + OS: Windows Linux64: enabled: 0 settings: @@ -36,7 +36,7 @@ PluginImporter: settings: CPU: None WebGL: - enabled: 1 + enabled: 0 settings: {} Win: enabled: 1 @@ -47,7 +47,7 @@ PluginImporter: settings: CPU: x86_64 WindowsStoreApps: - enabled: 1 + enabled: 0 settings: CPU: X86 DontProcess: false diff --git a/Assets/Scripts/SampleProject/AppMain.cs b/Assets/Scripts/SampleProject/AppMain.cs index 4fab5902..02a57987 100644 --- a/Assets/Scripts/SampleProject/AppMain.cs +++ b/Assets/Scripts/SampleProject/AppMain.cs @@ -1,4 +1,3 @@ -using Assets.Scripts.UVC.Log; using Cysharp.Threading.Tasks; using SampleProject.Config; using System; @@ -29,8 +28,10 @@ namespace SampleProject // 플레이 모드가 아닐 경우, 초기화 로직을 실행하지 않습니다. if (!Application.isPlaying) return; +#if !UNITY_WEBGL || UNITY_EDITOR //로깅 설정 - Log4netCodeConfigurator.Setup(); + UVC.Log.Log4netCodeConfigurator.Setup(); +#endif await SettupConfigAsync(); SetNetworkConfig(); diff --git a/Assets/Scripts/Simulator/SimulatorAppMain.cs b/Assets/Scripts/Simulator/SimulatorAppMain.cs index 7ab15dbc..938ac043 100644 --- a/Assets/Scripts/Simulator/SimulatorAppMain.cs +++ b/Assets/Scripts/Simulator/SimulatorAppMain.cs @@ -1,4 +1,4 @@ -using Assets.Scripts.UVC.Log; +using UVC.Log; using Cysharp.Threading.Tasks; using SampleProject.Config; using System; @@ -27,8 +27,10 @@ namespace Simulator // 플레이 모드가 아닐 경우, 초기화 로직을 실행하지 않습니다. if (!Application.isPlaying) return; +#if !UNITY_WEBGL || UNITY_EDITOR //로깅 설정 Log4netCodeConfigurator.Setup(); +#endif await SettupConfigAsync(); SetNetworkConfig(); diff --git a/Assets/Scripts/UVC/Log/Log4netCodeConfigurator.cs b/Assets/Scripts/UVC/Log/Log4netCodeConfigurator.cs index 473f7b07..4a939c16 100644 --- a/Assets/Scripts/UVC/Log/Log4netCodeConfigurator.cs +++ b/Assets/Scripts/UVC/Log/Log4netCodeConfigurator.cs @@ -1,3 +1,4 @@ +#if !UNITY_WEBGL || UNITY_EDITOR using log4net; using log4net.Appender; using log4net.Core; @@ -10,7 +11,7 @@ using System; using System.IO; using UnityEngine; -namespace Assets.Scripts.UVC.Log +namespace UVC.Log { /// /// xml 설정에서 AppData\LocalLow\Company Name\Product Name\ 접근 할 수 없어서 사용. @@ -122,3 +123,4 @@ namespace Assets.Scripts.UVC.Log } } +#endif \ No newline at end of file diff --git a/Assets/Scripts/UVC/Log/SQLiteAppender.cs b/Assets/Scripts/UVC/Log/SQLiteAppender.cs index 44adf626..c167cd3b 100644 --- a/Assets/Scripts/UVC/Log/SQLiteAppender.cs +++ b/Assets/Scripts/UVC/Log/SQLiteAppender.cs @@ -1,5 +1,5 @@ -#nullable enable - +#nullable enable +#if !UNITY_WEBGL || UNITY_EDITOR using log4net.Appender; using log4net.Core; using SQLite4Unity3d; @@ -177,3 +177,4 @@ namespace UVC.Log } } } +#endif \ No newline at end of file diff --git a/Assets/Scripts/UVC/Log/ULog.cs b/Assets/Scripts/UVC/Log/ULog.cs index 7941b4df..63c9678f 100644 --- a/Assets/Scripts/UVC/Log/ULog.cs +++ b/Assets/Scripts/UVC/Log/ULog.cs @@ -1,11 +1,12 @@ -#nullable enable - +#nullable enable +#if !UNITY_WEBGL || UNITY_EDITOR using log4net; using log4net.Appender; using log4net.Core; using log4net.Filter; using log4net.Layout; using log4net.Repository.Hierarchy; +#endif using System; using System.Diagnostics; using System.IO; @@ -15,12 +16,15 @@ namespace UVC.Log { public static class ULog { +#if !UNITY_WEBGL || UNITY_EDITOR private static readonly ILog logger = LogManager.GetLogger(typeof(ULog)); +#endif private static readonly bool useUnityDebug = true; // Unity Debug 사용 여부 static ULog() { +#if !UNITY_WEBGL || UNITY_EDITOR if (!useUnityDebug) { // unity runtime 일때 @@ -35,11 +39,13 @@ namespace UVC.Log //FileConfigure(); } } +#endif } public static void Debug(string msg) { +#if !UNITY_WEBGL || UNITY_EDITOR if (logger.IsDebugEnabled) { if (useUnityDebug) @@ -57,10 +63,14 @@ namespace UVC.Log logger.Debug(type.Name + "." + name + " [line " + lineNumber + "] " + msg); } } +#else + UnityEngine.Debug.Log(msg); +#endif } public static void Info(string msg) { +#if !UNITY_WEBGL || UNITY_EDITOR if (logger.IsInfoEnabled) { if (useUnityDebug) @@ -78,11 +88,15 @@ namespace UVC.Log logger.Info(type.Name + "." + name + " [line " + lineNumber + "] " + msg); } } +#else + UnityEngine.Debug.Log(msg); +#endif } public static void Warning(string msg, Exception? ex = null) { +#if !UNITY_WEBGL || UNITY_EDITOR if (logger.IsWarnEnabled) { if (useUnityDebug) @@ -100,10 +114,14 @@ namespace UVC.Log logger.Warn(type.Name + "." + name + " [line " + lineNumber + "] " + msg, ex); } } +#else + UnityEngine.Debug.LogWarning(msg); +#endif } public static void Error(string msg, Exception? ex = null) { +#if !UNITY_WEBGL || UNITY_EDITOR if (logger.IsErrorEnabled) { if (useUnityDebug) @@ -121,10 +139,15 @@ namespace UVC.Log logger.Error(type.Name + "." + name + " [line " + lineNumber + "] " + msg, ex); } } +#else + if (ex != null) UnityEngine.Debug.LogError($"{msg}\n{ex}"); + else UnityEngine.Debug.LogError(msg); +#endif } public static void Fatal(string msg, Exception? ex = null) { +#if !UNITY_WEBGL || UNITY_EDITOR if (logger.IsFatalEnabled) { if (useUnityDebug) @@ -142,9 +165,13 @@ namespace UVC.Log logger.Fatal(type.Name + "." + name + " [line " + lineNumber + "] " + msg, ex); } } +#else + if (ex != null) UnityEngine.Debug.LogError($"{msg}\n{ex}"); + else UnityEngine.Debug.LogError(msg); +#endif } - +#if !UNITY_WEBGL || UNITY_EDITOR /// /// log4net 파일 설정을 구성합니다. /// Assets/Resources/log4net.editor.xml log4net.runtime.xml 파일로 구성하였기에 사용안함. @@ -201,5 +228,6 @@ namespace UVC.Log } +#endif } } diff --git a/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset b/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset index ba670e0f..fabbc7a0 100644 --- a/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset +++ b/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset @@ -33,27 +33,27 @@ MonoBehaviour: m_Settings: m_SettingsList: m_List: - - rid: 4686066031286550718 - - rid: 4686066031286550719 + - rid: 4686066031286550733 + - rid: 4686066031286550734 - rid: 6852985685364965378 - rid: 6852985685364965379 - rid: 6852985685364965380 - rid: 6852985685364965381 - - rid: 4686066031286550720 - - rid: 4686066031286550721 + - rid: 4686066031286550735 + - rid: 4686066031286550736 - rid: 6852985685364965384 - rid: 6852985685364965385 - - rid: 4686066031286550722 - - rid: 4686066031286550723 - - rid: 4686066031286550724 - - rid: 4686066031286550725 - - rid: 4686066031286550726 - - rid: 4686066031286550727 + - rid: 4686066031286550737 + - rid: 4686066031286550738 + - rid: 4686066031286550739 + - rid: 4686066031286550740 + - rid: 4686066031286550741 + - rid: 4686066031286550742 - rid: 6852985685364965392 - - rid: 4686066031286550728 + - rid: 4686066031286550743 - rid: 6852985685364965394 - rid: 8712630790384254976 - - rid: 4686066031286550729 + - rid: 4686066031286550744 - rid: 7620972423683506177 - rid: -2 - rid: 3778867636856684545 @@ -154,14 +154,14 @@ MonoBehaviour: - {r: 0.5, g: 0, b: 0.5, a: 1} - {r: 0.5, g: 0.5, b: 0.5, a: 1} - {r: 0, g: 0, b: 1, a: 1} - - rid: 4686066031286550718 + - rid: 4686066031286550733 type: {class: URPShaderStrippingSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} data: m_Version: 0 m_StripUnusedPostProcessingVariants: 1 m_StripUnusedVariants: 1 m_StripScreenCoordOverrideVariants: 1 - - rid: 4686066031286550719 + - rid: 4686066031286550734 type: {class: UniversalRenderPipelineEditorShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} data: m_AutodeskInteractive: {fileID: 4800000, guid: 0e9d5a909a1f7e84882a534d0d11e49f, type: 3} @@ -173,7 +173,7 @@ MonoBehaviour: m_DefaultSpeedTree7Shader: {fileID: 4800000, guid: 0f4122b9a743b744abe2fb6a0a88868b, type: 3} m_DefaultSpeedTree8Shader: {fileID: -6465566751694194690, guid: 9920c1f1781549a46ba081a2a15a16ec, type: 3} m_DefaultSpeedTree9Shader: {fileID: -6465566751694194690, guid: cbd3e1cc4ae141c42a30e33b4d666a61, type: 3} - - rid: 4686066031286550720 + - rid: 4686066031286550735 type: {class: Renderer2DResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} data: m_Version: 0 @@ -188,7 +188,7 @@ MonoBehaviour: m_DefaultLitMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} m_DefaultUnlitMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2} m_DefaultMaskMaterial: {fileID: 2100000, guid: 15d0c3709176029428a0da2f8cecf0b5, type: 2} - - rid: 4686066031286550721 + - rid: 4686066031286550736 type: {class: UniversalRenderPipelineEditorMaterials, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} data: m_DefaultMaterial: {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} @@ -197,7 +197,7 @@ MonoBehaviour: m_DefaultTerrainMaterial: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2} m_DefaultDecalMaterial: {fileID: 2100000, guid: 31d0dcc6f2dd4e4408d18036a2c93862, type: 2} m_DefaultSpriteMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2} - - rid: 4686066031286550722 + - rid: 4686066031286550737 type: {class: GPUResidentDrawerResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.GPUDriven.Runtime} data: m_Version: 0 @@ -210,13 +210,13 @@ MonoBehaviour: m_OcclusionCullingDebugKernels: {fileID: 7200000, guid: b23e766bcf50ca4438ef186b174557df, type: 3} m_DebugOcclusionTestPS: {fileID: 4800000, guid: d3f0849180c2d0944bc71060693df100, type: 3} m_DebugOccluderPS: {fileID: 4800000, guid: b3c92426a88625841ab15ca6a7917248, type: 3} - - rid: 4686066031286550723 + - rid: 4686066031286550738 type: {class: STP/RuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} data: m_setupCS: {fileID: 7200000, guid: 33be2e9a5506b2843bdb2bdff9cad5e1, type: 3} m_preTaaCS: {fileID: 7200000, guid: a679dba8ec4d9ce45884a270b0e22dda, type: 3} m_taaCS: {fileID: 7200000, guid: 3923900e2b41b5e47bc25bfdcbcdc9e6, type: 3} - - rid: 4686066031286550724 + - rid: 4686066031286550739 type: {class: ProbeVolumeBakingResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} data: m_Version: 1 @@ -229,12 +229,12 @@ MonoBehaviour: skyOcclusionRT: {fileID: -5126288278712620388, guid: 5a2a534753fbdb44e96c3c78b5a6999d, type: 3} renderingLayerCS: {fileID: -6772857160820960102, guid: 94a070d33e408384bafc1dea4a565df9, type: 3} renderingLayerRT: {fileID: -5126288278712620388, guid: 94a070d33e408384bafc1dea4a565df9, type: 3} - - rid: 4686066031286550725 + - rid: 4686066031286550740 type: {class: ProbeVolumeGlobalSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} data: m_Version: 1 m_ProbeVolumeDisableStreamingAssets: 0 - - rid: 4686066031286550726 + - rid: 4686066031286550741 type: {class: ProbeVolumeDebugResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} data: m_Version: 1 @@ -244,21 +244,21 @@ MonoBehaviour: probeVolumeOffsetDebugShader: {fileID: 4800000, guid: db8bd7436dc2c5f4c92655307d198381, type: 3} probeSamplingDebugMesh: {fileID: -3555484719484374845, guid: 20be25aac4e22ee49a7db76fb3df6de2, type: 3} numbersDisplayTex: {fileID: 2800000, guid: 73fe53b428c5b3440b7e87ee830b608a, type: 3} - - rid: 4686066031286550727 + - rid: 4686066031286550742 type: {class: IncludeAdditionalRPAssets, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} data: m_version: 0 m_IncludeReferencedInScenes: 0 m_IncludeAssetsByLabel: 0 m_LabelToInclude: - - rid: 4686066031286550728 + - rid: 4686066031286550743 type: {class: ProbeVolumeRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} data: m_Version: 1 probeVolumeBlendStatesCS: {fileID: 7200000, guid: a3f7b8c99de28a94684cb1daebeccf5d, type: 3} probeVolumeUploadDataCS: {fileID: 7200000, guid: 0951de5992461754fa73650732c4954c, type: 3} probeVolumeUploadDataL2CS: {fileID: 7200000, guid: 6196f34ed825db14b81fb3eb0ea8d931, type: 3} - - rid: 4686066031286550729 + - rid: 4686066031286550744 type: {class: UniversalRenderPipelineEditorAssets, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} data: m_DefaultSettingsVolumeProfile: {fileID: 11400000, guid: eda47df5b85f4f249abf7abd73db2cb2, type: 2}