Is it possible to include TimeStamps and auto-scroll down?
cafigz opened this issue · comments
cafigz commented
Hi there! I love this logger and have been using it for months in my projects.
I just wanted to ask you if it's possible to add time stamps for the logs like in the example: (just so I'm able to know what time it was)
Also I wanted to have auto-scroll down, whenever a new message appears.
Thanks in advance! :D
cafigz commented
If anyone wants to add the time just do this to the LogCallback method:
DateTime date = DateTime.Now;
uiLogText.text += $"{date.Hour}:{date.Minute}:{date.Second}
private void LogCallback(string message, string stackTrace, LogType type)
{
//logTypeIndex => normal:0 , warning:1 , error:2
int logTypeIndex = (type == LogType.Log) ? 0 : (type == LogType.Warning) ? 1 : 2;
DateTime date = DateTime.Now;
uiLogText.text += $"{date.Hour}:{date.Minute}:{date.Second} | <sprite={logTypeIndex}><color={colors[logTypeIndex]}> {message}</color>\n\n";
ScrollDown();
}
hamza herbou commented
Hi .
you can print time with messages
"your message"+DateTime.Now.ToString();
…On Mon, Jul 11, 2022, 09:44 cafigz ***@***.***> wrote:
Closed #1 <#1> as completed.
—
Reply to this email directly, view it on GitHub
<#1 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AINUP2SQNIAFWGZC2HKWG3DVTPNHTANCNFSM52TZKQOQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
cafigz commented
Thanks, that's what I did :D
Do you know how can I have the logger automatically scroll down, whenever a new message appears?