Skip to content
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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

trv6
Copy link
Contributor

@trv6 trv6 commented Apr 26, 2022

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.

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.
Copy link
Member

@z16 z16 left a 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
Copy link
Member

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 = {}
Copy link
Member

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
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants