Change some PluginLog output verbosity scales and make independent of DEBUG macro.

This commit is contained in:
Ottermandias 2021-08-19 17:41:19 +02:00
parent bcc68d6684
commit 5c2f8aedad
2 changed files with 6 additions and 10 deletions

View file

@ -156,7 +156,7 @@ namespace Penumbra.Interop
file = Marshal.PtrToStringAnsi( new IntPtr( pPath ) )!; file = Marshal.PtrToStringAnsi( new IntPtr( pPath ) )!;
if( LogFileFilter == null || LogFileFilter.IsMatch( file ) ) 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 ); var replacementPath = modManager.ResolveSwappedOrReplacementPath( gameFsPath );
if( LogAllFiles && ( LogFileFilter == null || LogFileFilter.IsMatch( file ) ) ) 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 :( // path must be < 260 because statically defined array length :(
@ -187,9 +187,7 @@ namespace Penumbra.Interop
Crc32.Update( path ); Crc32.Update( path );
*pResourceHash = Crc32.Checksum; *pResourceHash = Crc32.Checksum;
#if DEBUG PluginLog.Verbose( "[GetResourceHandler] resolved {GamePath} to {NewPath}", gameFsPath, replacementPath );
PluginLog.Log( "[GetResourceHandler] resolved {GamePath} to {NewPath}", gameFsPath, replacementPath );
#endif
return CallOriginalHandler( isSync, pFileManager, pCategoryId, pResourceType, pResourceHash, pPath, pUnknown, isUnknown ); 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; return ReadSqpackHook?.OriginalFunction( pFileHandler, pFileDesc, priority, isSync ) ?? 0;
} }
#if DEBUG PluginLog.Debug( "loading modded file: {GameFsPath}", gameFsPath );
PluginLog.Log( "loading modded file: {GameFsPath}", gameFsPath );
#endif
pFileDesc->FileMode = FileMode.LoadUnpackedResource; pFileDesc->FileMode = FileMode.LoadUnpackedResource;

View file

@ -66,14 +66,14 @@ namespace Penumbra.UI
foreach( var fileName in picker.FileNames ) foreach( var fileName in picker.FileNames )
{ {
PluginLog.Log( $"-> {fileName} START" ); PluginLog.Information( $"-> {fileName} START" );
try try
{ {
_texToolsImport = new TexToolsImport( _manager.BasePath ); _texToolsImport = new TexToolsImport( _manager.BasePath );
_texToolsImport.ImportModPack( new FileInfo( fileName ) ); _texToolsImport.ImportModPack( new FileInfo( fileName ) );
PluginLog.Log( $"-> {fileName} OK!" ); PluginLog.Information( $"-> {fileName} OK!" );
} }
catch( Exception ex ) catch( Exception ex )
{ {