Use custom logger everywhere.

This commit is contained in:
Ottermandias 2022-09-15 15:02:23 +02:00
parent fabbeeae13
commit 72ef666d51
87 changed files with 276 additions and 371 deletions

View file

@ -2,7 +2,6 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Runtime.CompilerServices;
using Penumbra.GameData.Structs;
using Penumbra.GameData.Util;
using Penumbra.Interop.Structs;

View file

@ -1,6 +1,5 @@
using System;
using System.Numerics;
using Dalamud.Logging;
using Newtonsoft.Json;
using Penumbra.GameData.ByteString;
using Penumbra.GameData.Enums;
@ -125,7 +124,7 @@ public unsafe class ImcFile : MetaBaseFile
if( ActualLength > Length )
{
var newLength = ( ( ( ActualLength - 1 ) >> 7 ) + 1 ) << 7;
PluginLog.Verbose( "Resized IMC {Path} from {Length} to {NewLength}.", Path, Length, newLength );
Penumbra.Log.Verbose( $"Resized IMC {Path} from {Length} to {newLength}." );
ResizeResources( newLength );
}
@ -135,7 +134,7 @@ public unsafe class ImcFile : MetaBaseFile
Functions.MemCpyUnchecked( defaultPtr + i * NumParts, defaultPtr, NumParts * sizeof( ImcEntry ) );
}
PluginLog.Verbose( "Expanded IMC {Path} from {Count} to {NewCount} variants.", Path, oldCount, numVariants );
Penumbra.Log.Verbose( $"Expanded IMC {Path} from {oldCount} to {numVariants} variants." );
return true;
}
@ -151,7 +150,7 @@ public unsafe class ImcFile : MetaBaseFile
var variantPtr = VariantPtr( Data, partIdx, variantIdx );
if( variantPtr == null )
{
PluginLog.Error( "Error during expansion of imc file." );
Penumbra.Log.Error( "Error during expansion of imc file." );
return false;
}
@ -222,7 +221,7 @@ public unsafe class ImcFile : MetaBaseFile
var newData = Penumbra.MetaFileManager.AllocateDefaultMemory( ActualLength, 8 );
if( newData == null )
{
PluginLog.Error("Could not replace loaded IMC data at 0x{Data:X}, allocation failed." );
Penumbra.Log.Error($"Could not replace loaded IMC data at 0x{(ulong) resource:X}, allocation failed." );
return;
}
Functions.MemCpyUnchecked( newData, Data, ActualLength );

View file

@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using OtterGui.Filesystem;
using Penumbra.Interop.Structs;
using Penumbra.Meta.Files;
using Penumbra.Meta.Manipulations;
using Penumbra.Mods;
namespace Penumbra.Meta.Manager;

View file

@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Dalamud.Logging;
using FFXIVClientStructs.FFXIV.Client.System.Resource;
using OtterGui.Filesystem;
using Penumbra.Collections;
using Penumbra.GameData.ByteString;
using Penumbra.GameData.Enums;
using Penumbra.Interop.Structs;
@ -81,7 +78,7 @@ public partial class MetaManager
catch( Exception e )
{
++Penumbra.ImcExceptions;
PluginLog.Error( $"Could not apply IMC Manipulation:\n{e}" );
Penumbra.Log.Error( $"Could not apply IMC Manipulation:\n{e}" );
return false;
}
}
@ -156,7 +153,7 @@ public partial class MetaManager
return false;
}
PluginLog.Verbose( "Using ImcLoadHandler for path {$Path:l}.", path );
Penumbra.Log.Verbose( $"Using ImcLoadHandler for path {path}." );
ret = Penumbra.ResourceLoader.ReadSqPackHook.Original( resourceManager, fileDescriptor, priority, isSync );
var lastUnderscore = split.LastIndexOf( ( byte )'_' );
@ -166,8 +163,7 @@ public partial class MetaManager
&& collection.HasCache
&& collection.MetaCache!._imcFiles.TryGetValue( Utf8GamePath.FromSpan( path.Span, out var p ) ? p : Utf8GamePath.Empty, out var file ) )
{
PluginLog.Debug( "Loaded {GamePath:l} from file and replaced with IMC from collection {Collection:l}.", path,
collection.AnonymizedName );
Penumbra.Log.Debug( $"Loaded {path} from file and replaced with IMC from collection {collection.AnonymizedName}." );
file.Replace( fileDescriptor->ResourceHandle );
}

View file

@ -4,7 +4,6 @@ using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.CompilerServices;
using Dalamud.Logging;
using Penumbra.Collections;
using Penumbra.Interop.Structs;
using Penumbra.Meta.Files;
@ -165,7 +164,7 @@ public partial class MetaManager : IDisposable, IEnumerable< KeyValuePair< MetaM
}
Penumbra.CharacterUtility.LoadingFinished -= ApplyStoredManipulations;
PluginLog.Debug( "{Collection}: Loaded {Num} delayed meta manipulations.", _collection.Name, loaded );
Penumbra.Log.Debug( $"{_collection.AnonymizedName}: Loaded {loaded} delayed meta manipulations." );
}
[MethodImpl( MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization )]

View file

@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices;
using Penumbra.GameData.Structs;
using Penumbra.Interop.Structs;