Skip to content

Support re-opening (some) messages in full via the log menu#128

Merged
nthykier merged 6 commits intosingularity:masterfrom
nthykier:improve-logging-system
Aug 7, 2019
Merged

Support re-opening (some) messages in full via the log menu#128
nthykier merged 6 commits intosingularity:masterfrom
nthykier:improve-logging-system

Conversation

@nthykier
Copy link
Member

@nthykier nthykier commented Jan 27, 2019

With this branch, it will be possible to re-read messages (in full) via the log menu by double clicking on the log line.

Known issues:

  • Old save games may not work/convert properly (We bump the version and clear the old logs)
  • Use one shared set of named arguments
  • Solve the message ID problem (done in 39c85b7)
  • Events do not (yet) have a full message

@Xenega
Copy link
Member

Xenega commented Jan 27, 2019

For old savegames, just clear the old log dict. No need to perfectly handle case between major version.

I prefer that you use only one id and one args list for each log message. You need to use named args.

@nthykier
Copy link
Member Author

nthykier commented Jan 27, 2019 via email

@nthykier nthykier force-pushed the improve-logging-system branch 4 times, most recently from 45cd2d0 to c5c0045 Compare January 28, 2019 17:16
@Xenega
Copy link
Member

Xenega commented Jan 28, 2019

How would this work? To my knowledge, the short message and long message have different IDs, so we will need both IDs (unless we re-key relevant messages to use "%(msg_id)s_short" and "%(msg_id)s_full" for the short and long message respectively).

Yes, we can build two key with one ID by adding a prefix. However, strings.dat will disappear in the future (because it's generics and duplicate with message.po). You can help me by either use message.po or create a new _str.dat file for log message. The rational between the two is message.po contains all interface strings and _str.dat file contains all strings related to game content.

Orthewise, the idea is good.

@nthykier nthykier force-pushed the improve-logging-system branch 2 times, most recently from 6787580 to 17da31e Compare January 29, 2019 07:11
The end goal is to support re-opening the full message of the event.
However, this will come in a separate commit.

Signed-off-by: Niels Thykier <[email protected]>
Signed-off-by: Niels Thykier <[email protected]>
@nthykier nthykier force-pushed the improve-logging-system branch from 17da31e to 0e1b482 Compare August 7, 2019 09:17
@nthykier
Copy link
Member Author

nthykier commented Aug 7, 2019

I took a slightly different approach on this.

  • We now support the old format side-by-side with the new format. In theory, we could even covert them or we can later discard then if it becomes relevant.
  • We now log when techs have been researched, bases + items constructed etc. (Closes: Log more things #60)
  • For existing strings, we use the original method for looking up the string (usually via strings_str.dat). For new items, we lookup the text via _ and use its way of formatting.
  • The new style logs do not rely on particular strings/messages being logged. This enables us to change the message without breaking the translations and without relying on immutable keys in strings_str.dat. In fact, we can migrate from strings_str.dat style without breaking the savegame format (of new style logging).

@nthykier nthykier merged commit 33656c0 into singularity:master Aug 7, 2019
@nthykier nthykier deleted the improve-logging-system branch August 7, 2019 10:05
@nthykier nthykier mentioned this pull request Aug 7, 2019
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.

2 participants