Skip to content

Commit ad95e31

Browse files
committed
fix(map-server): use consistent [ViewState] log prefix
1 parent 2a3d6f4 commit ad95e31

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

examples/map-server/src/mcp-app.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ interface PersistedCameraState {
100100
function getViewStorageKey(): string {
101101
const context = app.getHostContext();
102102
const toolId = context?.toolInfo?.id ?? "default";
103-
log.info("Storage key context:", { toolId, toolInfo: context?.toolInfo });
104103
return `map:${toolId}`;
105104
}
106105

@@ -147,9 +146,9 @@ function persistViewState(cesiumViewer: any): void {
147146

148147
try {
149148
localStorage.setItem(key, JSON.stringify(state));
150-
log.info("Persisted view state to", key, state);
149+
log.info("[ViewState] saved to", key, state);
151150
} catch (e) {
152-
log.warn("Failed to persist view state:", e);
151+
log.warn("[ViewState] save failed:", e);
153152
}
154153
}
155154

@@ -158,12 +157,11 @@ function persistViewState(cesiumViewer: any): void {
158157
*/
159158
function loadPersistedViewState(): PersistedCameraState | null {
160159
const key = getViewStorageKey();
161-
log.info("Attempting to load view state from", key);
162160

163161
try {
164162
const stored = localStorage.getItem(key);
165163
if (!stored) {
166-
log.info("No persisted view state found for", key);
164+
log.info("[ViewState] none found for", key);
167165
return null;
168166
}
169167

@@ -174,13 +172,13 @@ function loadPersistedViewState(): PersistedCameraState | null {
174172
typeof state.latitude !== "number" ||
175173
typeof state.height !== "number"
176174
) {
177-
log.warn("Invalid persisted view state, ignoring:", state);
175+
log.warn("[ViewState] invalid data, ignoring:", state);
178176
return null;
179177
}
180-
log.info("Loaded persisted view state from", key, state);
178+
log.info("[ViewState] loaded from", key, state);
181179
return state;
182180
} catch (e) {
183-
log.warn("Failed to load persisted view state:", e);
181+
log.warn("[ViewState] load failed:", e);
184182
return null;
185183
}
186184
}

0 commit comments

Comments
 (0)