Skip to content

Commit 8f2b50b

Browse files
committed
Fix deprication issue
1 parent 8a2e0e0 commit 8f2b50b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

SpecRec/CallLogger.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,14 @@ public class CallLogger
375375
/// </summary>
376376
public string FormatValue(object? value) => _callLog.FormatValue(value);
377377

378-
[Obsolete("Use CallLogger() or CallLogger(CallLog, ObjectFactory) instead. StringBuilder-based constructor is deprecated.")]
379-
public CallLogger(StringBuilder? specbook = null, ObjectFactory? objectFactory = null)
378+
[Obsolete("StringBuilder-based constructor is deprecated. Use CallLogger() instead.")]
379+
public CallLogger(StringBuilder specbook, ObjectFactory? objectFactory = null)
380380
{
381381
_objectFactory = objectFactory ?? ObjectFactory.Instance();
382382
_callLog = new CallLog(objectFactory: _objectFactory);
383383

384384
// For backward compatibility, if a StringBuilder was provided, we need to sync it
385-
if (specbook != null && specbook.Length > 0)
385+
if (specbook.Length > 0)
386386
{
387387
_callLog.Append(specbook.ToString());
388388
specbook.Clear(); // Prevent duplication
@@ -392,10 +392,10 @@ public CallLogger(StringBuilder? specbook = null, ObjectFactory? objectFactory =
392392
/// <summary>
393393
/// Constructor for internal use with specific CallLog.
394394
/// </summary>
395-
public CallLogger(CallLog callLog, ObjectFactory? objectFactory = null)
395+
public CallLogger(CallLog? callLog = null, ObjectFactory? objectFactory = null)
396396
{
397-
_callLog = callLog;
398397
_objectFactory = objectFactory ?? ObjectFactory.Instance();
398+
_callLog = callLog ?? new CallLog(objectFactory: _objectFactory);
399399
}
400400

401401
public T Wrap<T>(T target, string emoji = "🔧") where T : class

0 commit comments

Comments
 (0)