Silfur Engine # 4: Silfur ! Talk to me one last time!
Hello everyone :)
Welcome to this 4th devlog on the Silfur Engine. After 5 months of absence due to a turbulent personal life, I'm back to rewrite my adventures on the development of this engine.
This devlog will deal with the finalization of the log system and more exactly with an idea inspired by the Unreal Engine. This is the creation of "channels" for the log system.
Using the channels
Before, we used the log system this way:
I added a parameter to use a dedicated channel for the log and so to classify by what we want. It is used like this:
Here it is the Init channel. I have created several usable channels and the user can also create his own channels. Here is the (non-exhaustive) list of available channels in the engine:
To create a channel, you only have to use 2 macros respecting their order:
This will create a channel with a global variable (structure) throughout your project. You can also declare a variable called "static" (structure) this way:
Implementation in the Silfur Engine
To implement these channels in the engine, it was necessary to create a LogChannel class with a LogChannelBase base class in order to have an abstraction level available for, in the future, create more advanced channels in their functionality:
And with this class, we can create macros to create the final channels:
Changing the log file creation
Before, a new file was created at each launch of an application using the engine. To avoid using unnecessary disk space, the file of the former execution is deleted if it exists and a new one is created:
Now, the log system is officially finished and functional.
Thank you for reading and I tell you see you soon for a devlog on the change of the work environment. ;)
Leave a comment
Log in with itch.io to leave a comment.