We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d73474 commit e20c7adCopy full SHA for e20c7ad
1 file changed
lua/fittencode/log.lua
@@ -29,16 +29,16 @@ local function get_level_name(level)
29
return LOG_LEVEL_NAMES[level + 1] or 'UNKNOWN'
30
end
31
32
-local function get_ns_time()
+local function get_milliseconds()
33
local sec, usec = vim.uv.gettimeofday()
34
if sec == nil then
35
- usec = 0
+ return 0
36
37
- return usec * 1000
+ return math.floor(usec / 1000)
38
39
40
local function format_timestamp()
41
- local ns = string.format('%09d', get_ns_time())
+ local ns = string.format('%03d', get_milliseconds())
42
local date = os.date('%Y-%m-%dT%H:%M:%S')
43
-- +0800 -> +08:00
44
local timezone = tostring(os.date('%z'))
0 commit comments