Fixed the Logging system to actually be able to handle errors. Database is also fixed to use directories.
This commit is contained in:
@@ -69,7 +69,7 @@ namespace ehs
|
||||
const ImgCodec* codec = GetCodec(ext);
|
||||
if (!codec)
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Codec not found for file extension, \"" + ext + "\".");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Codec not found for file extension, \"" + ext + "\".");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -877,7 +877,7 @@ namespace ehs
|
||||
const ImgCodec* codec = GetCodec(ext);
|
||||
if (!codec)
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Codec not found for file extension, \"" + ext + "\".");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Codec not found for file extension, \"" + ext + "\".");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1560,7 +1560,7 @@ namespace ehs
|
||||
Str_8 imgType = in.ReadStr<Char_8, UInt_64>(4);
|
||||
if (imgType != "qoif")
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Given data is not in the qoif format.");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Given data is not in the qoif format.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1653,7 +1653,7 @@ namespace ehs
|
||||
UInt_8 colorType = ihdrData->Read<UInt_8>();
|
||||
if (colorType == 3)
|
||||
{
|
||||
EHS_LOG_INT("Error", 1, "Color type of " + Str_8::FromNum(colorType) + " is unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 1, "Color type of " + Str_8::FromNum(colorType) + " is unsupported.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1670,21 +1670,21 @@ namespace ehs
|
||||
UInt_8 compression = ihdrData->Read<UInt_8>();
|
||||
if (compression)
|
||||
{
|
||||
EHS_LOG_INT("Error", 2, "Compression method of " + Str_8::FromNum(compression) + " is unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 2, "Compression method of " + Str_8::FromNum(compression) + " is unsupported.");
|
||||
return false;
|
||||
}
|
||||
|
||||
UInt_8 filter = ihdrData->Read<UInt_8>();
|
||||
if (filter)
|
||||
{
|
||||
EHS_LOG_INT("Error", 3, "Filter method of " + Str_8::FromNum(filter) + " is unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 3, "Filter method of " + Str_8::FromNum(filter) + " is unsupported.");
|
||||
return false;
|
||||
}
|
||||
|
||||
UInt_8 interlaced = ihdrData->Read<UInt_8>();
|
||||
if (interlaced)
|
||||
{
|
||||
EHS_LOG_INT("Error", 4, "Interlacing method of " + Str_8::FromNum(interlaced) + " is unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 4, "Interlacing method of " + Str_8::FromNum(interlaced) + " is unsupported.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1709,7 +1709,7 @@ namespace ehs
|
||||
int code = inflateInit(&strm);
|
||||
if (code != Z_OK)
|
||||
{
|
||||
EHS_LOG_INT("Error", 5, "Failed to initialize zlib inflate with error #" + Str_8::FromNum(code) + ".");
|
||||
EHS_LOG_INT(LogType::ERR, 5, "Failed to initialize zlib inflate with error #" + Str_8::FromNum(code) + ".");
|
||||
delete[] buffer;
|
||||
return false;
|
||||
}
|
||||
@@ -1719,7 +1719,7 @@ namespace ehs
|
||||
code = inflate(&strm, Z_NO_FLUSH);
|
||||
if (code != Z_STREAM_END && code != Z_OK)
|
||||
{
|
||||
EHS_LOG_INT("Error", 6, "Failed to zlib inflate with error #" + Str_8::FromNum(code) + ".");
|
||||
EHS_LOG_INT(LogType::ERR, 6, "Failed to zlib inflate with error #" + Str_8::FromNum(code) + ".");
|
||||
delete[] buffer;
|
||||
return false;
|
||||
}
|
||||
@@ -1728,7 +1728,7 @@ namespace ehs
|
||||
code = inflateEnd(&strm);
|
||||
if (code != Z_OK)
|
||||
{
|
||||
EHS_LOG_INT("Error", 7, "Failed to uninitialize zlib inflate with error #" + Str_8::FromNum(code) + ".");
|
||||
EHS_LOG_INT(LogType::ERR, 7, "Failed to uninitialize zlib inflate with error #" + Str_8::FromNum(code) + ".");
|
||||
delete[] buffer;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace ehs
|
||||
{
|
||||
if (!encoder)
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Encoding is not supported for the " + id + " format.");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Encoding is not supported for the " + id + " format.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace ehs
|
||||
{
|
||||
if (!decoder)
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Decoding is not supported for the " + id + " format.");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Decoding is not supported for the " + id + " format.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace ehs
|
||||
Array<Byte, UInt_64> seq = data.ReadArray<Byte, UInt_64>(8);
|
||||
if (seq != pngSeq)
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "File at file path, \"" + filePath + "\", is not a valid PNG file.");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "File at file path, \"" + filePath + "\", is not a valid PNG file.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user