-
-
Notifications
You must be signed in to change notification settings - Fork 818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Add timestamps to logs that don't support them #3778
Labels
command: console
command: mods
command: start
distro: Debian
info: tmux
type: feature request
New feature or request
Milestone
Comments
github-actions
bot
added
command: console
command: mods
command: start
distro: Debian
info: tmux
and removed
type: feature request
New feature or request
labels
Feb 8, 2022
Imo, generally a good idea, but not a priority atm. Feel free to create a pull request if you feel like you're able to implement it yourself. |
13 tasks
13 tasks
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
command: console
command: mods
command: start
distro: Debian
info: tmux
type: feature request
New feature or request
User Story
As a server admin, I want to be able to view timestamps for my server logs.
Basic info
Implementation
I have tried to implement this after interacting with the Github mods gentlemen on Discord.
I have found that we can prepend all lines of log with the timestamp by modifying these lines:
LinuxGSM/lgsm/functions/command_start.sh
Line 95 in fdfeae1
LinuxGSM/lgsm/functions/command_start.sh
Line 111 in fdfeae1
Should be changed to:
With a global variable (using
gawk
for readability)Or without gawk we can just put this script in a one liner:
I tested this on my rustserver, and the output:
Becomes:
I didn't add a check to manage lines with whitespaces because that would make the code too complex and unreadable.
We can also use
ts
frommoreutils
package but it adds dependencies:We can also add a global variable to activate timestamps on certain games, not all. And a variable for the format.
Although this solution is not ideal, because the timestamp won't be precise for every line, but each time tmux dumps logs to the file, every line included in that dump will have the same timestamp of the moment the dump occurs. It still is much better than no timestamps at all in my opinion.
I'd like your feedback on this. Would you like something like this to be included in your code? Do you think there is something else I should add for this to be included in your codebase?
I'd like your feedback on this.
The text was updated successfully, but these errors were encountered: