MCPcopy Create free account
hub / github.com/Effect-TS/effect / structuredMessage

Function structuredMessage

packages/effect/src/internal/logger.ts:262–273  ·  view source on GitHub ↗
(u: unknown)

Source from the content-addressed store, hash-verified

260
261/** @internal */
262export const structuredMessage = (u: unknown): unknown => {
263 switch (typeof u) {
264 case "bigint":
265 case "function":
266 case "symbol": {
267 return String(u)
268 }
269 default: {
270 return Inspectable.toJSON(u)
271 }
272 }
273}
274
275const errorToJSON = (u: unknown): unknown =>
276 isError(u) && !hasProperty(u, "toJSON") ? { ...u, name: u.name, message: u.message } : u

Callers 3

logger.tsFile · 0.85
prettyLoggerTtyFunction · 0.85
prettyLoggerBrowserFunction · 0.85

Calls 2

StringInterface · 0.85
toJSONMethod · 0.65

Tested by

no test coverage detected