修正warning日志级别

Signed-off-by: liduo <liduo29@huawei.com>
This commit is contained in:
liduo
2025-05-19 21:09:23 +08:00
parent 87ec999ec2
commit aa361b5d66
7 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -553,7 +553,7 @@ uint32_t PackageParser::HandleProcess(int c, const string &argValue)
{
auto handler = handles_.find(c);
if (handler == handles_.end()) {
cout << "Warning: unsupport " << c << endl;
PrintError(GetError(ERR_CODE_UNKNOWN_OPTION).FormatCause(std::to_string(c).c_str()));
return RESTOOL_ERROR;
}
return handler->second(argValue);
+6 -6
View File
@@ -125,8 +125,8 @@ uint32_t CompressionParser::Init()
bool CompressionParser::ParseCompression(const cJSON *compressionNode)
{
if (!compressionNode) {
cout << "Warning: get 'compression' node is empty, the compiled images are not transcoded.";
cout << NEW_LINE_PATH << filePath_ << endl;
cerr << "Warning: get 'compression' node is empty, the compiled images are not transcoded.";
cerr << NEW_LINE_PATH << filePath_ << endl;
return true;
}
if (!cJSON_IsObject(compressionNode)) {
@@ -135,8 +135,8 @@ bool CompressionParser::ParseCompression(const cJSON *compressionNode)
}
cJSON *mediaNode = cJSON_GetObjectItem(compressionNode, "media");
if (!mediaNode) {
cout << "Warning: get 'media' node is empty, the compiled images are not transcoded.";
cout << NEW_LINE_PATH << filePath_ << endl;
cerr << "Warning: get 'media' node is empty, the compiled images are not transcoded.";
cerr << NEW_LINE_PATH << filePath_ << endl;
return true;
}
if (!cJSON_IsObject(mediaNode)) {
@@ -145,8 +145,8 @@ bool CompressionParser::ParseCompression(const cJSON *compressionNode)
}
cJSON *enableNode = cJSON_GetObjectItem(mediaNode, "enable");
if (!enableNode) {
cout << "Warning: get 'enable' node is empty, the compiled images are not transcoded.";
cout << NEW_LINE_PATH << filePath_ << endl;
cerr << "Warning: get 'enable' node is empty, the compiled images are not transcoded.";
cerr << NEW_LINE_PATH << filePath_ << endl;
return true;
}
if (!cJSON_IsBool(enableNode)) {
+2 -2
View File
@@ -135,7 +135,7 @@ bool ConfigParser::SetAppIcon(string &icon, int64_t id)
{
cJSON *appNode = cJSON_GetObjectItem(root_, "app");
if (!appNode || !cJSON_IsObject(appNode)) {
cout << "Warning: 'app' not object" << endl;
cerr << "Warning: 'app' not object" << endl;
return false;
}
cJSON_AddStringToObject(appNode, "icon", icon.c_str());
@@ -147,7 +147,7 @@ bool ConfigParser::SetAppLabel(string &label, int64_t id)
{
cJSON *appNode = cJSON_GetObjectItem(root_, "app");
if (!appNode || !cJSON_IsObject(appNode)) {
cout << "Warning: 'app' not object" << endl;
cerr << "Warning: 'app' not object" << endl;
return false;
}
cJSON_AddStringToObject(appNode, "label", label.c_str());
+1 -1
View File
@@ -50,7 +50,7 @@ bool FileEntry::Init()
{
string filePath = filePath_.GetPath();
if (!Exist(filePath)) {
cout << "Warning: file not exist: " << filePath << endl;
cerr << "Warning: file not exist: " << filePath << endl;
return false;
}
+2 -2
View File
@@ -104,8 +104,8 @@ uint32_t IdDefinedParser::Init(const string &filePath, bool isSystem)
return RESTOOL_ERROR;
}
if (cJSON_GetArraySize(recordNode) == 0) {
cout << "Warning: 'record' node is empty, please check the JSON file.";
cout << NEW_LINE_PATH << filePath << endl;
cerr << "Warning: 'record' node is empty, please check the JSON file.";
cerr << NEW_LINE_PATH << filePath << endl;
return RESTOOL_SUCCESS;
}
int64_t startSysId = 0;
+1 -1
View File
@@ -72,7 +72,7 @@ void ResourceCheck::CheckNodeInResourceItem(const string &key, const ResourceIte
return;
}
if (width != height) {
cout << "Warning: the png width and height not equal" << NEW_LINE_PATH << filePath << endl;
cerr << "Warning: the png width and height not equal" << NEW_LINE_PATH << filePath << endl;
return;
}
auto result = g_keyNodeIndexs.find(key);
+2 -2
View File
@@ -490,8 +490,8 @@ bool ResourceUtil::IsValidName(const string &name)
void ResourceUtil::PrintWarningMsg(vector<pair<ResType, string>> &noBaseResource)
{
for (const auto &item : noBaseResource) {
cout << "Warning: the " << ResourceUtil::ResTypeToString(item.first);
cout << " of '" << item.second << "' does not have a base resource." << endl;
cerr << "Warning: the " << ResourceUtil::ResTypeToString(item.first);
cerr << " of '" << item.second << "' does not have a base resource." << endl;
}
}