Skip to content

Commit c120816

Browse files
committed
Remove debug logs from registry and protocol modules
Eliminated unnecessary console logging and unique registry ID from SchemaRegistry and ObjectStackRuntimeProtocol. This streamlines output and reduces noise during normal operation.
1 parent e132220 commit c120816

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

packages/objectql/src/registry.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { ServiceObject, App, ObjectStackManifest } from '@objectstack/spec';
77
export class SchemaRegistry {
88
// Nested Map: Type -> Name/ID -> MetadataItem
99
private static metadata = new Map<string, Map<string, any>>();
10-
private static _id = Math.random().toString(36).substring(7);
1110

1211
/**
1312
* Universal Register Method
@@ -23,23 +22,17 @@ export class SchemaRegistry {
2322
const key = String(item[keyField]);
2423

2524
if (collection.has(key)) {
26-
console.warn(`[Registry:${this._id}] Overwriting ${type}: ${key}`);
25+
console.warn(`[Registry] Overwriting ${type}: ${key}`);
2726
}
2827
collection.set(key, item);
29-
console.log(`[Registry:${this._id}] Registered ${type}: ${key}`);
28+
console.log(`[Registry] Registered ${type}: ${key}`);
3029
}
3130

3231
/**
3332
* Universal Get Method
3433
*/
3534
static getItem<T>(type: string, name: string): T | undefined {
36-
const item = this.metadata.get(type)?.get(name) as T;
37-
if (!item) {
38-
console.log(`[Registry:${this._id}] MISSING ${type}: ${name}. Available: ${Array.from(this.metadata.get(type)?.keys() || [])}`);
39-
} else {
40-
console.log(`[Registry:${this._id}] FOUND ${type}: ${name}`);
41-
}
42-
return item;
35+
return this.metadata.get(type)?.get(name) as T;
4336
}
4437

4538
/**

packages/runtime/src/protocol.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export class ObjectStackRuntimeProtocol {
7676

7777
// 4. Metadata: Get Single Item
7878
getMetaItem(typePlural: string, name: string) {
79-
console.log(`[Protocol] getMetaItem called for ${typePlural}/${name}`);
8079
const typeMap: Record<string, string> = {
8180
'objects': 'object',
8281
'apps': 'app',
@@ -86,7 +85,6 @@ export class ObjectStackRuntimeProtocol {
8685
'kinds': 'kind'
8786
};
8887
const type = typeMap[typePlural] || typePlural;
89-
console.log(`[Protocol] Resolved type: ${type}`);
9088
const item = SchemaRegistry.getItem(type, name);
9189
if (!item) throw new Error(`Metadata not found: ${type}/${name}`);
9290
return item;

0 commit comments

Comments
 (0)