[+] Added critical log level
[*] Fix win32 DELETE bug
This commit is contained in:
parent
5d979bff6d
commit
4cac821fbb
@ -18,7 +18,8 @@ namespace Aurora::Logging
|
||||
eVerbose,
|
||||
eError,
|
||||
eDebug,
|
||||
eWarn
|
||||
eWarn,
|
||||
eCritical
|
||||
));
|
||||
|
||||
static auto const kLogLevelDefault = static_cast<AuUInt8>(kELogLevelMinLegal);
|
||||
@ -86,6 +87,12 @@ namespace Aurora::Logging
|
||||
WriteLinef(static_cast<AuUInt8>(ELogLevel::eWarn), EAnsiColor::eRed, "Warn", line, AuForward<T>(args)...);
|
||||
}
|
||||
|
||||
template<typename ... T>
|
||||
inline void LogCritical(const AuString &line, T&& ... args)
|
||||
{
|
||||
WriteLinef(static_cast<AuUInt8>(ELogLevel::eCritical), EAnsiColor::eBoldRed, "Warn", line, AuForward<T>(args)...);
|
||||
}
|
||||
|
||||
template<typename ... T>
|
||||
inline void LogError(const AuString &line, T&& ... args)
|
||||
{
|
||||
|
@ -119,6 +119,12 @@ namespace Aurora::Logging
|
||||
WriteLinef(static_cast<AuUInt8>(ELogLevel::eError), EAnsiColor::eBoldRed, "Error", line, AuForward<T>(args)...);
|
||||
}
|
||||
|
||||
template<typename Line_t, typename ... T>
|
||||
inline void LogCritical(const Line_t &line, T&& ... args)
|
||||
{
|
||||
WriteLinef(static_cast<AuUInt8>(ELogLevel::eCritical), EAnsiColor::eBoldRed, "Critical", line, AuForward<T>(args)...);
|
||||
}
|
||||
|
||||
template<typename Line_t, typename ... T>
|
||||
inline void LogGame(const Line_t &line, T&& ... args)
|
||||
{
|
||||
@ -169,6 +175,12 @@ namespace Aurora::Logging
|
||||
WriteLine(static_cast<AuUInt8>(ELogLevel::eError), ConsoleMessage(EAnsiColor::eBoldRed, "Error", line));
|
||||
}
|
||||
|
||||
template<typename Line_t, typename ... T>
|
||||
inline void LogCritical(const Line_t &line, T&& ... args)
|
||||
{
|
||||
WriteLine(static_cast<AuUInt8>(ELogLevel::eCritical), ConsoleMessage(EAnsiColor::eBoldRed, "Critical", line));
|
||||
}
|
||||
|
||||
template<typename Line_t>
|
||||
static void LogGame(const Line_t &line)
|
||||
{
|
||||
@ -191,6 +203,7 @@ ADD_AU_GLOBAL_ALIAS(Warn)
|
||||
ADD_AU_GLOBAL_ALIAS(Error)
|
||||
ADD_AU_GLOBAL_ALIAS(Game)
|
||||
ADD_AU_GLOBAL_ALIAS(Verbose)
|
||||
ADD_AU_GLOBAL_ALIAS(Critical)
|
||||
|
||||
#if defined(STAGING) || defined(DEBUG)
|
||||
ADD_AU_GLOBAL_ALIAS(VerboseNoShip)
|
||||
|
@ -252,7 +252,7 @@ namespace Aurora::IO::FS
|
||||
if (bCheck)
|
||||
{
|
||||
fileHandle = ::CreateFileW(win32Path.c_str(),
|
||||
GENERIC_WRITE | GENERIC_READ,
|
||||
GENERIC_WRITE | GENERIC_READ | DELETE,
|
||||
NULL,
|
||||
NULL,
|
||||
CREATE_NEW,
|
||||
@ -261,10 +261,10 @@ namespace Aurora::IO::FS
|
||||
}
|
||||
else
|
||||
{
|
||||
fileHandle = CreateFileW(win32Path.c_str(), GENERIC_WRITE | GENERIC_READ, dwShare, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
fileHandle = CreateFileW(win32Path.c_str(), GENERIC_WRITE | GENERIC_READ | DELETE, dwShare, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (fileHandle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
fileHandle = CreateFileW(win32Path.c_str(), GENERIC_WRITE, dwShare, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
fileHandle = CreateFileW(win32Path.c_str(), GENERIC_WRITE | DELETE, dwShare, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,7 +277,7 @@ namespace Aurora::IO::FS
|
||||
if (bCheck)
|
||||
{
|
||||
fileHandle = ::CreateFileW(win32Path.c_str(),
|
||||
GENERIC_WRITE,
|
||||
GENERIC_WRITE | DELETE,
|
||||
NULL,
|
||||
NULL,
|
||||
CREATE_NEW,
|
||||
@ -286,10 +286,10 @@ namespace Aurora::IO::FS
|
||||
}
|
||||
else
|
||||
{
|
||||
fileHandle = CreateFileW(win32Path.c_str(), GENERIC_WRITE | FILE_READ_ATTRIBUTES, dwShare, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
fileHandle = CreateFileW(win32Path.c_str(), GENERIC_WRITE | FILE_READ_ATTRIBUTES | DELETE, dwShare, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (fileHandle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
fileHandle = CreateFileW(win32Path.c_str(), GENERIC_WRITE, dwShare, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
fileHandle = CreateFileW(win32Path.c_str(), GENERIC_WRITE | DELETE, dwShare, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user