跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

logs.bash

30 行 · 901 B历史下载
1# SPDX-FileCopyrightText: Copyright The Lima Authors
2# SPDX-License-Identifier: Apache-2.0
3
4# Format the string the way strconv.Quote() would do.
5# If the input ends with an ellipsis then no closing quote will be added (and the … will be removed).
6quote_msg() {
7 local quoted
8 quoted=$(sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/"/' <<<"$1")
9 if [[ $quoted == *… ]]; then
10 echo "${quoted%…}"
11 else
12 echo "${quoted}\""
13 fi
14}
15
16assert_fatal() {
17 assert_stderr_line --partial "level=fatal msg=$(quote_msg "$1")"
18}
19assert_error() {
20 assert_stderr_line --partial "level=error msg=$(quote_msg "$1")"
21}
22assert_warning() {
23 assert_stderr_line --partial "level=warning msg=$(quote_msg "$1")"
24}
25assert_info() {
26 assert_stderr_line --partial "level=info msg=$(quote_msg "$1")"
27}
28assert_debug() {
29 assert_stderr_line --partial "level=debug msg=$(quote_msg "$1")"
30}