Skip to content

Commit b55f597

Browse files
ChristophLHRColdIV
andcommitted
Log function fixed
Removed redundant logs Co-authored-by: Josh <[email protected]>
1 parent d0fc8e6 commit b55f597

File tree

4 files changed

+5
-14
lines changed

4 files changed

+5
-14
lines changed

libs/scm/autocomplete.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---@class Autocomplete
32
local Autocomplete = {}
43
SCM.Autocomplete = Autocomplete
@@ -209,7 +208,6 @@ $ help <name>
209208
] = {}
210209
end
211210
end
212-
log("Done")
213211
else
214212
log("Download failed")
215213
end
@@ -272,18 +270,17 @@ $ help <name>
272270
self.commands["add"]["args"] = t
273271
end
274272

275-
276273
---@param t table
277274
function Autocomplete:setLibaries(t)
278275
self.commands["require"]["args"] = t
279276
end
280277

281-
function Autocomplete:handleArguments (args)
278+
function Autocomplete:handleArguments(args)
282279
if #args == 0 then
283280
SCM.UI:cli(false, args)
284281
return
285282
end
286-
283+
287284
if args[1] and self.commands[args[1]] then
288285
self.commands[args[1]]["func"](args)
289286
if SCM.Config.config["cliPrefix"] then

libs/scm/log.lua

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
local Log = {}
33
SCM.Log = Log
44
do
5-
local config = {}
6-
function Log:init(lib)
7-
config = lib["config"].config
8-
end
9-
105
function Log:log(message)
6+
local config = SCM.Config.config
117
local datetime = ""
128
if config["logDate"] then datetime = "" .. os.date("[%Y-%m-%d %H:%M:%S] ") end
139
if config["verbose"] then print(config["printPrefix"] .. message) end
14-
10+
1511
if config["writeLogFile"] then
1612
local file = fs.open(config["logFilePath"], "a")
1713
file.write(datetime .. message .. "\n")
@@ -21,4 +17,4 @@ do
2117
end
2218

2319

24-
return Log
20+
return Log

libs/scm/net.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ do
316316
] = {}
317317
end
318318
end
319-
log("Done")
320319
else
321320
log("Download failed")
322321
end

libs/scm/scriptManager.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ do
293293
self:checkRequirements(name)
294294
local path = "./" .. config()["libraryDirectory"] .. name
295295
local script = require(path)
296-
log("Done")
297296
return script
298297
end
299298

0 commit comments

Comments
 (0)