Skip to content

chore: migrate motoko/canister_logs to icp-cli#1369

Open
marc0olo wants to merge 12 commits into
masterfrom
chore/migrate-canister-logs-to-icp-cli
Open

chore: migrate motoko/canister_logs to icp-cli#1369
marc0olo wants to merge 12 commits into
masterfrom
chore/migrate-canister-logs-to-icp-cli

Conversation

@marc0olo

@marc0olo marc0olo commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

Migrates motoko/canister_logs from dfx to icp-cli.

  • Replace dfx.json with icp.yaml (@dfinity/motoko@v5.0.0)
  • Move src/Main.mobackend/app.mo; rename actor to CanisterLogs
  • Replace inline actor("aaaaa-aa") with import { ic } "mo:ic" for ic.raw_rand()
  • Update mops.toml: moc 1.9.0, core 2.5.0, ic 4.0.0; apply mops check --fix
  • Add Makefile with 11 tests covering Debug.print (update + replicated query), explicit traps with "right before" pre-trap messages, memory OOB, timer trap, raw_rand; replace @- with 2>/dev/null || true for clean CI output
  • Update poll_logs.sh to parse JSON output (icp-cli returns JSON, not dfx's formatted text) using jq; track last-seen index to show only new entries
  • CI workflow (icp-dev-env-motoko:0.3.2)
  • README: update log format section to show actual JSON output with jq/python3 one-liners for human-readable extraction

Test plan

  • motoko-canister_logs CI passes

🤖 Generated with Claude Code

marc0olo and others added 12 commits June 10, 2026 17:17
Replace dfx tooling with icp-cli: add icp.yaml, update mops.toml to
moc 1.9.0 and core 2.5.0, move src/Main.mo to backend/app.mo, replace
inline actor("aaaaa-aa") raw_rand with mo:ic ic.raw_rand(), rewrite
Makefile tests for icp canister call/logs, add CI workflow, and update README.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tandardize test labels

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rmat to README

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
icp canister logs returns compact JSON, not the formatted text dfx produced.

README:
- Replace outdated formatted log example with actual JSON output
- Add jq and python one-liners for human-readable extraction
- Note the format is JSON with index/timestamp/content fields

poll_logs.sh:
- Rewrite to parse JSON using jq (the old string comparison approach
  didn't work since the entire output is one JSON line)
- Track last seen index to show only new entries
- Add jq dependency check with install instructions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo marked this pull request as ready for review June 11, 2026 20:44
@marc0olo marc0olo requested review from a team as code owners June 11, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants