Time with Clock/Duration, tracing spans, and structured logging. Use for time-based logic, deadlines, and observability.
import { Clock, Duration } from "effect"
const now = yield* Clock.currentTimeMillis
yield* Effect.sleep(Duration.seconds(1))
const guarded = yield* Effect.timeout(task, Duration.seconds(2))
const op = Effect.withSpan("operation")(Effect.succeed(1))
yield* Effect.logInfo("message")
yield* Effect.logDebug("debug")
yield* Effect.logError("error")
import { Effect, Option, Logger, LogLevel, Layer } from "effect"
export const setMinimumLogLevel = (cliLevel: Option.Option<LogLevel.LogLevel>) =>
APP_CONFIG["LOG_LEVEL"].pipe(
Effect.map((envLevel) => Option.zipLeft(cliLevel, envLevel)),
Effect.map(Option.getOrElse(() => LogLevel.Info)),
Effect.map((level) => Logger.minimumLogLevel(level)),
Layer.unwrapEffect
)
Duration helpers for clarity of unitsDuration consistentlyCRITICAL: Search local Effect source before implementing
The full Effect source code is available at docs/effect-source/. Always search the actual implementation before writing Effect code.
docs/effect-source/effect/src/Clock.tsdocs/effect-source/effect/src/Duration.tsdocs/effect-source/effect/src/Effect.tsdocs/effect-source/effect/src/Logger.tsdocs/effect-source/effect/src/LogLevel.ts# Find Clock operations
grep -F "currentTimeMillis" docs/effect-source/effect/src/Clock.ts
grep -F "sleep" docs/effect-source/effect/src/Clock.ts
# Study Duration helpers
grep -F "seconds" docs/effect-source/effect/src/Duration.ts
grep -F "millis" docs/effect-source/effect/src/Duration.ts
grep -F "minutes" docs/effect-source/effect/src/Duration.ts
# Find span and logging patterns
grep -F "withSpan" docs/effect-source/effect/src/Effect.ts
grep -F "logInfo" docs/effect-source/effect/src/Effect.ts
grep -F "logError" docs/effect-source/effect/src/Effect.ts
# Look at Logger implementation
grep -F "minimumLogLevel" docs/effect-source/effect/src/Logger.ts
docs/effect-source/effect/src/ for the implementationReal source code > documentation > assumptions
npx skills add mepuka/effect-time-tracing-logging下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer