Skip to content

Commit

Permalink
Add trace logging
Browse files Browse the repository at this point in the history
  • Loading branch information
boatbomber committed Jul 10, 2023
1 parent 7181df3 commit 5e7930c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugin/src/Reconciler/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ end

function Reconciler:hookPrecommit(callback: (patch: any, instanceMap: any) -> ()): () -> ()
table.insert(self.__precommitCallbacks, callback)
Log.trace("Added precommit callback: {}", callback)

return function()
-- Remove the callback from the list
for i, cb in self.__precommitCallbacks do
if cb == callback then
table.remove(self.__precommitCallbacks, i)
Log.trace("Removed precommit callback: {}", callback)
break
end
end
Expand All @@ -40,12 +42,14 @@ end

function Reconciler:hookPostcommit(callback: (patch: any, instanceMap: any, unappliedPatch: any) -> ()): () -> ()
table.insert(self.__postcommitCallbacks, callback)
Log.trace("Added postcommit callback: {}", callback)

return function()
-- Remove the callback from the list
for i, cb in self.__postcommitCallbacks do
if cb == callback then
table.remove(self.__postcommitCallbacks, i)
Log.trace("Removed postcommit callback: {}", callback)
break
end
end
Expand Down

0 comments on commit 5e7930c

Please sign in to comment.