Skip to content

Commit

Permalink
chore: fix logging for factory
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-welker committed May 16, 2024
1 parent a5b406f commit b0faa1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SonyBraviaFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ public SonyBraviaFactory()

public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(DebugLevels.TraceLevel, "[{0}] Building {1} plugin instance...", dc.Name, dc.Type);
Debug.Console(DebugLevels.TraceLevel, "[{0}] Building {1} plugin instance...", dc.Key, dc.Type);

var props = dc.Properties.ToObject<SonyBraviaConfig>();
if (props == null)
{
Debug.Console(DebugLevels.TraceLevel, "[{0}] Failed to build {1} plugin", dc.Name, dc.Type);
Debug.Console(DebugLevels.TraceLevel, "[{0}] Failed to build {1} plugin", dc.Key, dc.Type);
return null;
}

var comms = CommFactory.CreateCommForDevice(dc);
if (comms != null) return new SonyBraviaDevice(dc, comms);

Debug.Console(DebugLevels.TraceLevel, "[{0}] Failed to build {1} plugin using {2}", dc.Name, dc.Type, props.Control.Method);
Debug.Console(DebugLevels.TraceLevel, "[{0}] Failed to build {1} plugin using {2}", dc.Key, dc.Type, props.Control.Method);
return null;
}
}
Expand Down

0 comments on commit b0faa1b

Please sign in to comment.