Skip to content

Commit f5c0220

Browse files
authored
Merge pull request #117 from LiliaFramework/codex/add-logging-to-all-modules
Remove obsolete logger file
2 parents 687c016 + d5601a1 commit f5c0220

File tree

8 files changed

+27
-214
lines changed

8 files changed

+27
-214
lines changed

advert/commands.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
ClientAddText(ply, Color(216, 190, 18), L("AdvertFormat", displayedName), Color(255, 255, 255), message)
2626
end
2727

28+
lia.log.add(client, "advert", message)
29+
2830
hook.Run("AdvertSent", client, message)
2931
else
3032
client:notifyLocalized("AdvertInsufficientFunds")

advert/libraries/server.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lia.log.addType("advert", function(client, msg)
2+
return string.format("%s advertised: %s", IsValid(client) and client:Name() or "Console", msg)
3+
end, "Gameplay")

alcoholism/libraries/server.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,10 @@ end
4949

5050
function MODULE:PostPlayerLoadout(client)
5151
client:ResetBAC()
52-
end
52+
end
53+
lia.log.addType("bacIncrease", function(client, amt, newBac)
54+
return string.format("%s BAC increased by %s to %s%%", client:Name(), amt, newBac)
55+
end, "Gameplay")
56+
lia.log.addType("bacReset", function(client)
57+
return string.format("%s became sober", client:Name())
58+
end, "Gameplay")

alcoholism/meta/sh_player.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if SERVER then
66
hook.Run("BACChanged", self, 0)
77
hook.Run("BACReset", self)
88
hook.Run("PostBACReset", self)
9+
lia.log.add(self, "bacReset")
910
end
1011

1112
function playerMeta:AddBAC(amt)
@@ -15,6 +16,7 @@ if SERVER then
1516
local newBac = math.Clamp(oldBac + amt, 0, 100)
1617
self:setNetVar("lia_alcoholism_bac", newBac)
1718
hook.Run("BACChanged", self, newBac)
19+
lia.log.add(self, "bacIncrease", amt, newBac)
1820
hook.Run("BACIncreased", self, amt, newBac)
1921
local threshold = lia.config.get("DrunkNotifyThreshold", 50)
2022
if oldBac < threshold and newBac >= threshold then hook.Run("BACThresholdReached", self, newBac) end

cigs/entities/weapons/weapon_ciga/init.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function MODULE.cigaUpdate(ply, cigaID)
1414
hook.Run("PlayerInhaleSmoke", ply, cigaID, ply.cigaCount)
1515
if ply.cigaCount == 1 then
1616
hook.Run("PlayerStartSmoking", ply, cigaID)
17+
lia.log.add(ply, "smokeStart")
1718
ply.cigaArm = true
1819
net.Start("cigaArm")
1920
net.WriteEntity(ply)
@@ -38,6 +39,7 @@ function MODULE.Releaseciga(ply)
3839
if not ply.cigaCount then ply.cigaCount = 0 end
3940
if ply.cigaCount >= 5 then hook.Run("PlayerPuffSmoke", ply, ply.cigaID, ply.cigaCount) end
4041
hook.Run("PlayerStopSmoking", ply, ply.cigaID)
42+
lia.log.add(ply, "smokeStop")
4143
if IsValid(ply:GetActiveWeapon()) and ply:GetActiveWeapon():GetClass():sub(1, 11) == "weapon_ciga" then
4244
if ply.cigaCount >= 5 then
4345
net.Start("ciga")

cigs/libraries/server.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lia.log.addType("smokeStart", function(client)
2+
return string.format("%s started smoking", client:Name())
3+
end, "Gameplay")
4+
lia.log.addType("smokeStop", function(client)
5+
return string.format("%s stopped smoking", client:Name())
6+
end, "Gameplay")

corpseid/libraries/server.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
hook.Run("CorpseIdentifyStarted", client, targetPlayer, corpse)
77
client:setAction(L("identifyingCorpse"), IDTime, function()
88
client:ChatPrint(L("identifiedCorpseMessage", targetPlayer:Nick()))
9+
lia.log.add(client, "corpseIdentified", targetPlayer)
910
hook.Run("CorpseIdentified", client, targetPlayer, corpse)
1011
end)
1112
end
@@ -39,3 +40,7 @@ end
3940
function MODULE:ShouldSpawnClientRagdoll()
4041
return false
4142
end
43+
44+
lia.log.addType("corpseIdentified", function(client, target)
45+
return string.format("%s identified corpse of %s", client:Name(), target:Name())
46+
end, "Gameplay")

logger.lua

Lines changed: 0 additions & 213 deletions
This file was deleted.

0 commit comments

Comments
 (0)