[Template] Simple Logging Backend

Show us your completed creations made in Construct 2

Post » Wed Jul 13, 2016 5:32 pm

Hi Constructururers! :mrgreen:

My newest creation isn't really a game, nor a template (for a game). It's something that could help anyone anywhen with nearly all possible problems/bugs/issues, totally unregarding what they are scripting/coding.

What is logging?
If you have never heared of "logging" or arent sure, if its something software specific, eatable or if it glows in the dark, I can recommend you this article (not from me, Im just too lazy to explain pros and cons (if any...) about logging at this point ;) : http://vasir.net/blog/development/how-logging-made-me-a-better-developer .

Simple Logging Backend

Image
(view the 10/10 cover image from above in fullscreen: http://proxy.wtf/_storage/construct2/simple_logging_template/c2_template_logging_backend.PNG)

What is this template about?
It offers you a leightweight logging backend; offering 3 log-levels (info, warning, error) into a TextBox and/or into the browers console. It's kept as simple and compact (and understandable) as possible.
On 27 lines of code (and about 40 lines of comments :D ) Ive documented every single step (partially with additional informations to make it absolutely (at least I hope so) beginner/noob friendly).

For who is this template?
I love using debugging tools - unregarded if its Construct2, PowerShell, C# or any other code-/script/programming language. Its a pain in the back to find an error which occours sporadically or doesnt seems clear at first.
This template is aimed for beginners/noobs. Ive commented everything (as already mentioned) to make sure, its absolutely understandable. Maybe beside the logging-engine itself this might give a feeling about functions and their parameters (and, of course, working with them) - and maybe some other logic-stuff.

Features:
- Logging into browser console and/or TextBox (multiline!)
- 3 log-levels; info (for example: something triggered), warnings for non-critical issues (for example: chest appeared before a mob was killed), errors (for example: player exits the isolated bossfight area during bossfight before killing the boss (events which will have a huge negative impact on the game; or will break progress)
- Costumize the used characters for prefixes, also different prefix contents

ToDo:
When Ive got time (and people are using this, of course), i might add additional features.
- UNIX & human-readable-format timestamp
- Export whole logfile (or a number of rows) as file
This list may be extended in the future.

Sidenote:
Currently, theres only using the tickcount implemented. For me, its good enough to use. As long as it isnt possible to get system time or ask a ntp-server whats going on, without plugins, Ill not implement any other "source of time" for now. Like mentioned above; when Im feeling to, Ill add a "real" timestamping-method.
This template can be used everywhere and anywhen (sending the source to mars is strictly allowed!). I hope, that some can profit from this template and may learn a bit from the logic behind C2 (if you are an absolute beginner with C2).


Unregarding if someone uses this or not, every kind of feedback is accepted (and wished) here! In a world without feedback (especially negative responses), everyone would be lost while ending up coding flappy bird clon.... oh, wait... ;)


Have a great day
Proxy

Downloads:
> 13.07.2016 | version 1 | initial release
> http://proxy.wtf/_storage/construct2/simple_logging_template/Logging_Template_v1_by_Proxy.capx



P.S.: my english isnt the best, sorry for that :D if anything is unclear (how mentioned at least 20 times in the sources comments), feel free to PN me here, or better: just answer to this topic; ill do my best to make things clear.
B
24
S
15
G
9
Posts: 118
Reputation: 6,864

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 2 guests