Reece
d8e000b5c3
[*] Fix up gen1 copypasta [+] ConsoleMessage::ToPersistentString [*] Adjust ConsoleMessage formatting
57 lines
1.5 KiB
C++
57 lines
1.5 KiB
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: ConsoleMessage.hpp
|
|
Date: 2021-6-10
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
namespace Aurora::Threading::Threads
|
|
{
|
|
AUKN_SYM AuThreadId_t GetThreadId();
|
|
}
|
|
|
|
namespace Aurora::Time
|
|
{
|
|
AUKN_SYM AuUInt64 CurrentClockMS();
|
|
}
|
|
|
|
namespace Aurora::Console
|
|
{
|
|
class ConsoleMessage
|
|
{
|
|
public:
|
|
EAnsiColor color;
|
|
AuString prefix;
|
|
AuString line;
|
|
AuUInt64 time;
|
|
AuThreadId_t tid;
|
|
|
|
inline ConsoleMessage()
|
|
{
|
|
color = EAnsiColor::eReset;
|
|
tid = 0;
|
|
time = 0;
|
|
}
|
|
|
|
inline ConsoleMessage(const AuString &prefix, const AuString &line) : prefix(prefix), line(line), color(EAnsiColor::eReset)
|
|
{
|
|
time = Time::CurrentClockMS();
|
|
tid = Threading::Threads::GetThreadId();
|
|
}
|
|
|
|
inline ConsoleMessage(const EAnsiColor color, const AuString &prefix, const AuString &line) : prefix(prefix), line(line), color(color)
|
|
{
|
|
time = Time::CurrentClockMS();
|
|
tid = Threading::Threads::GetThreadId();
|
|
}
|
|
|
|
AUKN_SYM AuString StringifyTime(bool simple = false) const;
|
|
AUKN_SYM AuString StringifyTimeUTC() const;
|
|
AUKN_SYM AuString GetWrappedTag() const;
|
|
AUKN_SYM AuString ToConsole() const;
|
|
AUKN_SYM AuString ToPersistentString() const;
|
|
AUKN_SYM AuString ToSimplified() const;
|
|
};
|
|
} |