Skip to content

Commit 6e13a9b

Browse files
committed
Add more logs
1 parent b69717e commit 6e13a9b

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/main/dumpers/schemas/filesystem_exporter.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ void DumpClasses(const std::vector<IntermediateSchemaClass>& classes, std::files
6666
{
6767
if (!std::filesystem::is_directory(schemaPath / intermediateClass.module))
6868
if (!std::filesystem::create_directory(schemaPath / intermediateClass.module))
69-
return;
69+
{
70+
spdlog::error("Failed to create directory for class module '{}'", intermediateClass.module);
71+
continue;
72+
}
7073

7174
// Some classes have :: in them which we can't save.
7275
auto sanitizedFileName = intermediateClass.name;
@@ -106,7 +109,7 @@ void DumpClasses(const std::vector<IntermediateSchemaClass>& classes, std::files
106109
for (const auto& field : intermediateClass.fields)
107110
{
108111
spdlog::trace("Dumping field: '{}' for class: '{}'", field.name, intermediateClass.name);
109-
// Output metadata entires as comments before the field definition
112+
// Output metadata entries as comments before the field definition
110113
for (const auto& metadata : field.metadata)
111114
{
112115
OutputMetadataEntry(metadata, output, true);
@@ -126,7 +129,10 @@ void DumpEnums(const std::vector<IntermediateSchemaEnum>& enums, std::filesystem
126129
{
127130
if (!std::filesystem::is_directory(schemaPath / intermediateEnum.module))
128131
if (!std::filesystem::create_directory(schemaPath / intermediateEnum.module))
129-
return;
132+
{
133+
spdlog::error("Failed to create directory for enum module '{}'", intermediateEnum.module);
134+
continue;
135+
}
130136

131137
// Some classes have :: in them which we can't save.
132138
auto sanitizedFileName = intermediateEnum.name;
@@ -137,6 +143,7 @@ void DumpEnums(const std::vector<IntermediateSchemaEnum>& enums, std::filesystem
137143

138144
std::ofstream output((schemaPath / intermediateEnum.module / sanitizedFileName).replace_extension(".h"));
139145

146+
spdlog::trace("Dumping enum: '{}'", intermediateEnum.name);
140147
for (const auto& metadata : intermediateEnum.metadata)
141148
{
142149
OutputMetadataEntry(metadata, output, false);
@@ -147,7 +154,7 @@ void DumpEnums(const std::vector<IntermediateSchemaEnum>& enums, std::filesystem
147154

148155
for (const auto& member : intermediateEnum.members)
149156
{
150-
// Output metadata entires as comments before the field definition
157+
// Output metadata entries as comments before the field definition
151158
for (const auto& metadata : member.metadata)
152159
{
153160
OutputMetadataEntry(metadata, output, true);
@@ -168,7 +175,10 @@ void Dump(const std::vector<IntermediateSchemaEnum>& enums, const std::vector<In
168175

169176
if (!std::filesystem::is_directory(schemaPath))
170177
if (!std::filesystem::create_directory(schemaPath))
178+
{
179+
spdlog::error("Failed to create schemas directory");
171180
return;
181+
}
172182

173183
std::map<std::string, std::unordered_set<std::string>> foundFiles;
174184

src/main/dumpers/schemas/schemas.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ void DumpEnums(CSchemaSystemTypeScope* typeScope, std::vector<IntermediateSchema
113113
break;
114114
}
115115

116+
spdlog::trace("Dumping enum: '{}'", enumInfo->m_pszName);
117+
116118
IntermediateSchemaEnum schemaEnum{
117119
.name = std::string(enumInfo->m_pszName),
118120
.module = std::string(enumInfo->m_pszProjectName),
@@ -128,6 +130,7 @@ void DumpEnums(CSchemaSystemTypeScope* typeScope, std::vector<IntermediateSchema
128130
for (uint16_t k = 0; k < enumInfo->m_nEnumeratorCount; k++)
129131
{
130132
const auto& field = enumInfo->m_pEnumerators[k];
133+
spdlog::trace("Dumping enumerator: '{}' for enum: '{}'", field.m_pszName, enumInfo->m_pszName);
131134
IntermediateSchemaEnumMember member{
132135
.name = std::string(field.m_pszName),
133136
.value = field.m_nValue,

src/main/globalvariables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ namespace Globals {
3131
inline std::string versionDate;
3232
inline std::string versionTime;
3333

34-
} // namespace Interfaces
34+
} // namespace Globals

0 commit comments

Comments
 (0)