New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a log file for debugging pointwatch message ids #2182
base: dev
Are you sure you want to change the base?
Conversation
This would create a small file in the data folder after reading from a dialog dat. If someone noticed buggy behavior with the offsets, they could verify that the number in the log file matches the number they get from following the steps in the fixing pointwatch file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm honestly not sure what this does, but if I also don't know much about PW or how it handles DAT files. Is this done automatically, always? Or only with some debug flag? Because I would very much prefer the latter. If someone has an issue they could still be told to enable the flag and reproduce it, right? This is otherwise just a lot of extra work that seems needless for regular operations.
f:write(os.date() .. '\n' .. table.concat(s, '\n')) | ||
f:close() | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this end
not one too many? Or what is it meant to close?
@@ -211,7 +215,21 @@ local function update_offset(zone_id) | |||
end | |||
|
|||
m.offset = res[1] | |||
m.name = nil | |||
m.update = nil | |||
local s = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer some better variable names. I realize that m
and f
also weren't perfect before, but no need to repeat those mistakes :) In fact, can adjust them while you're in there.
s[n] = t.name .. '\t' .. tostring(t.offset) | ||
end | ||
end | ||
if n > 0 then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't n
always be > 0
? At least 1
, because you set m.update
to nil
above, so if you iterate the messages after that, at least the current message (m
) would result in not t.update
being true
?
This would create a small file in the data folder after reading from a dialog dat. If someone noticed buggy behavior with the offsets, they could verify that the number in the log file matches the number they get from following the steps in the fixing pointwatch file.