Recent

Author Topic: [SOLVED] Game logging template — StdOut, StdErr  (Read 2331 times)

furious programming

  • Hero Member
  • *****
  • Posts: 858
Re: Game logging template — StdOut, StdErr
« Reply #15 on: January 06, 2023, 01:47:09 pm »
Ok, I played with this topic a bit more and decided that for now I will not implement detecting the existence of the system console and redirecting the output to it. I will stay with the current solution, i.e. console support only in debug builds, and in release versions, a log file will always be created and all information will be saved in it. If in the future it turns out that users need to see the log in the console, I will add support to it (e.g. in the form of input arguments).

Second, I gave up using Write and WriteLn directly, and instead added functions with array of const parameters. This allowed me to create a set of functions for logging events with different priorities and add an option to set the priority. A simple system, similar to this from SDL, but at least the data is logged in the format I want it to be (so that it is easy to filter logs and look for problems).

Well, that's all for now. Thank you all for your replies.
Lazarus 3.2 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on an acrade, action/adventure game in retro style (pixelart), programming the engine and shell from scratch, using Free Pascal and SDL. Release planned in 2026.

 

TinyPortal © 2005-2018