I've got a function that will pretty up the logs a little. Ultimately, it adds HTML elements into the output display of the logs without cluttering up the logs on the back end.
I'm quite impressed with how well it works, but the trouble is the setup function is called BEFORE the logs are loaded. So calling it from setup results in absolutely nothing happening.
The first solution I can think of is starting a timer and then calling the function after an arbitrary length of time. Trouble is, too little time and the function could call before the logs are displayed. Too long and the beautification is laggy.
The next solution was maybe imbedding script tags into the first log, and calling it from there. I haven't tried that yet, so I don't know whether or not there is security protocol specifically designed to stop me doing stuff like that. Maybe there is. Also, writing script into a log feels a bit inelegant. (Also, if it runs the risk of executing while someone is browsing my logs from a different system, and maybe doing damage unintentionally if there's a namespace clash.)
The third solution, and probably the one I'll end up using if no one can think of something cleaner, is to just write the pretty html directly into the logs. Still a bad solution, but the least bad available.
What other solutions are there? The ultimate solution would be finding a way to have my function trigger as soon as the logs have loaded.
I'm quite impressed with how well it works, but the trouble is the setup function is called BEFORE the logs are loaded. So calling it from setup results in absolutely nothing happening.
The first solution I can think of is starting a timer and then calling the function after an arbitrary length of time. Trouble is, too little time and the function could call before the logs are displayed. Too long and the beautification is laggy.
The next solution was maybe imbedding script tags into the first log, and calling it from there. I haven't tried that yet, so I don't know whether or not there is security protocol specifically designed to stop me doing stuff like that. Maybe there is. Also, writing script into a log feels a bit inelegant. (Also, if it runs the risk of executing while someone is browsing my logs from a different system, and maybe doing damage unintentionally if there's a namespace clash.)
The third solution, and probably the one I'll end up using if no one can think of something cleaner, is to just write the pretty html directly into the logs. Still a bad solution, but the least bad available.
What other solutions are there? The ultimate solution would be finding a way to have my function trigger as soon as the logs have loaded.