From 5c2f8aedada3b382b355439d543677ad4e7d7fb5 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Thu, 19 Aug 2021 17:41:19 +0200 Subject: [PATCH] Change some PluginLog output verbosity scales and make independent of DEBUG macro. --- Penumbra/Interop/ResourceLoader.cs | 12 ++++-------- Penumbra/UI/MenuTabs/TabImport.cs | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Penumbra/Interop/ResourceLoader.cs b/Penumbra/Interop/ResourceLoader.cs index 5dc06d67..58153eda 100644 --- a/Penumbra/Interop/ResourceLoader.cs +++ b/Penumbra/Interop/ResourceLoader.cs @@ -156,7 +156,7 @@ namespace Penumbra.Interop file = Marshal.PtrToStringAnsi( new IntPtr( pPath ) )!; if( LogFileFilter == null || LogFileFilter.IsMatch( file ) ) { - PluginLog.Log( "[GetResourceHandler] {0}", file ); + PluginLog.Information( "[GetResourceHandler] {0}", file ); } } @@ -168,7 +168,7 @@ namespace Penumbra.Interop var replacementPath = modManager.ResolveSwappedOrReplacementPath( gameFsPath ); if( LogAllFiles && ( LogFileFilter == null || LogFileFilter.IsMatch( file ) ) ) { - PluginLog.Log( "[GetResourceHandler] {0}", file ); + PluginLog.Information( "[GetResourceHandler] {0}", file ); } // path must be < 260 because statically defined array length :( @@ -187,9 +187,7 @@ namespace Penumbra.Interop Crc32.Update( path ); *pResourceHash = Crc32.Checksum; -#if DEBUG - PluginLog.Log( "[GetResourceHandler] resolved {GamePath} to {NewPath}", gameFsPath, replacementPath ); -#endif + PluginLog.Verbose( "[GetResourceHandler] resolved {GamePath} to {NewPath}", gameFsPath, replacementPath ); return CallOriginalHandler( isSync, pFileManager, pCategoryId, pResourceType, pResourceHash, pPath, pUnknown, isUnknown ); } @@ -211,9 +209,7 @@ namespace Penumbra.Interop return ReadSqpackHook?.OriginalFunction( pFileHandler, pFileDesc, priority, isSync ) ?? 0; } -#if DEBUG - PluginLog.Log( "loading modded file: {GameFsPath}", gameFsPath ); -#endif + PluginLog.Debug( "loading modded file: {GameFsPath}", gameFsPath ); pFileDesc->FileMode = FileMode.LoadUnpackedResource; diff --git a/Penumbra/UI/MenuTabs/TabImport.cs b/Penumbra/UI/MenuTabs/TabImport.cs index 1088ebbe..59aebdd2 100644 --- a/Penumbra/UI/MenuTabs/TabImport.cs +++ b/Penumbra/UI/MenuTabs/TabImport.cs @@ -66,14 +66,14 @@ namespace Penumbra.UI foreach( var fileName in picker.FileNames ) { - PluginLog.Log( $"-> {fileName} START" ); + PluginLog.Information( $"-> {fileName} START" ); try { _texToolsImport = new TexToolsImport( _manager.BasePath ); _texToolsImport.ImportModPack( new FileInfo( fileName ) ); - PluginLog.Log( $"-> {fileName} OK!" ); + PluginLog.Information( $"-> {fileName} OK!" ); } catch( Exception ex ) {