Feature Add option to log CLI output to file

Irrat

Member
Often there's quite a bit of info in cli that just doesn't make it to other logs, generally the missing information are all printed by scripts.

Adding a new option to start logging cli into a folder could be an idea, I can't tell you how many times I'm trying to figure out exactly what happened in a script but it wasn't saved somewhere.

So to be clear, anything that the user would see in console is now written in a folder with files, like session is. But with the html extension, like chat is.

I figure this should be opt in for sure, given it could be quite spammy.
 

Irrat

Member
So just had a thought.

Should the mirror command be printing out exactly what's in gcli? I notice it seems to be printing out what's written at different steps, which obviously means the final comparison are not the same.

Mostly just html formatting. Which is another thing, it doesn't let you apply a html suffix to the file.

So I'm interested to know if the difference in output is intended or not.

Could be that the mirror code could be stripped down in favor of using chat buffer entirely. I think this hugely depends on what functionality mirror is intended for exactly.

One example is running a cli command. The message that echos what you entered has html formatting applied in cli but not in mirror.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I'm fine with changing mirror to more exactly copy the GCLI output but I must ask why on earth you want it
 

Irrat

Member
I'm fine with changing mirror to more exactly copy the GCLI output but I must ask why on earth you want it
Because session doesn't log all CLI output and sometimes it's useful to know exactly what was printed in CLI, especially when you're confused on something that happened (eg, a script made a choice and printed why it made said choice)

Also, it can be easier to read the CLI output instead of the session output if you're not used to reading session.
 
Last edited:

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
But why do you need html for that
 

fronobulax

Developer
Staff member
I have, upon occasion, wanted something in the session log that was only appearing in the gCLI. My solution was often to change the code to log the specific thing to both places. I would remember the mirror command and then get frustrated with the results because the gCLI and the mirror did not handle HTML the same way and some automated processing of the mirror became more difficult as a result.

My solution was to not allow HTML in the gCLI but we know how popular that idea was.

If it was clearly understood how mirror treated (or should treat) gcLI HTML I can make a case for documenting and implementing that treatment.

It is trivial to read a plain text file (with some HTML) in a browser and it is also trivial to rename a txt file to have an htm or html extension so the mirror, as is, may answer the request and the fix is some education concerning processing text files.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
The change can be applied to mirror, it's not really a defined interface that we need to not change at all
 

fronobulax

Developer
Staff member
After looking at the PR I'm a little confused.

The feature request seems to be to make sure everything written to the gCLI is also written to the mirror file when one is enabled.

There seems to be a second feature request to allow a user to explicitly name a mirror file with an html extension.

if anyone wants to address my confusion before I do, a failing test might be quite helpful although if it is as simple as running a one line script with a print and observing the output is not captured I can get to that :)
 
Top