Codync
免費、開源的 1:1 替代方案,取代 Grok Bot 與 Muse。從 iPhone、Mac 或 Linux 桌面將 Claude Code、Codex、Cursor 與 40+ 程式碼代理人作為持續機器人傳訊。群組聊天、主題串…
AI 翻譯
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Rails Semantic Logger replaces the Rails default logger with Semantic Logger, so that Rails, your application code, and many common gems all log through structured logging instead of plain text.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Rails Semantic Logger replaces the Rails default logger with Semantic Logger, so that Rails, your application code, and many common gems all log through structured logging instead of plain text.
When any large Rails application is deployed to production one of the first steps is to move to centralized logging, so that logs can be viewed and searched from a central location. That quickly falls apart when consuming human readable text logs:
Switching to structured logging, or logs in JSON format, makes centralized logging in testing and production far more powerful. Rails Semantic Logger also collapses the several lines Rails normally logs per request into a single structured "Completed" line, while keeping every field (controller, action, status, durations, and so on) searchable.
Add to your Gemfile:
gem "rails_semantic_logger"
gem "amazing_print" # optional, colorizes the structured payload in development
Then run bundle install. That is all that is required: Rails Semantic Logger automatically replaces the standard Rails logger and writes to the usual Rails log file.
Remove the following gems if present, they conflict with or duplicate what this gem already does: lograge, rails_stdout_logging, rails_12factor.
With no configuration at all, Rails Semantic Logger:
log/<environment>.log, the same file Rails uses, colorized when Rails colorized logging is enabled.rails server, so you see requests in your terminal.rails console, so log lines do not get mixed up with command return values.An appender is a destination for log output: a file, standard out, a centralized log service, and so on. Declare the appenders you want in a single block. The method name says when the appender is created; the arguments say where it writes and how it is formatted.
| Method | Created when… | Default destination |
|---|---|---|
add | Always, during Rails initialization | (you must specify one) |
add_server | Only when serving requests: rails server, a rack server, Sidekiq in server mode | $stdout |
add_console | Only inside a rails console session | $stderr |
The arguments to all three are exactly the arguments to SemanticLogger.add_appender, so anything Semantic Logger can log to, any of these can declare.
Important: As soon as you declare any appender in this block, Rails Semantic Logger stops adding all of its automatic appenders (the default
log/<env>.logfile, the standard-out logger underrails server, and the standard-error logger inrails console). The block becomes the single source of truth for every destination.
A typical development setup, a color log file plus color to the screen while serving:
config.rails_semantic_logger.appenders do |appenders|
appenders.add(file_name: "log/#{Rails.env}.log", formatter: :color)
appenders.add_server(formatter: :color) # → $stdout, only when serving
end
On a container platform (Docker, Kubernetes, Heroku), log JSON to standard out and let the platform collect it:
config.rails_semantic_logger.appenders do |appenders|
appenders.add(io: $stdout, formatter: :json)
end
Because declaring an appender replaces the default file appender, JSON to stdout becomes the only destination, exactly what a container platform wants. Once logs are emitted as structured JSON, a centralized logging system can parse each field, including the nested payload and any metric data, into a searchable hierarchy, so you can build searches, alerts, and dashboards against well-defined fields instead of brittle text matching.
See Configuring appenders for the full guide, including formatters, third-party destinations, the container platform recipe, tuning what Rails logs, and worked examples of querying the JSON.
For complete documentation see: https://logger.reidmorrison.com/rails
The way appenders (log destinations) are configured changed in v5. See the v4 to v5 migration guide for the before/after mapping, and Migrating from earlier versions for older releases.
The primary purpose of the Rails Semantic Logger gem is to patch other gems, primarily Rails, to make them support structured logging though Semantic Logger.
When new versions of Rails and other gems are published they often make changes to the internals, so the existing patches stop working.
Rails Semantic Logger survives only when someone in the community upgrades to a newer Rails or other supported libraries, runs into problems, and then contributes the fix back to the community by means of a pull request.
Additionally, when new popular gems come out, we rely only the community to supply the necessary patches in Rails Semantic Logger to make those gems support structured logging.
For the complete list of supported Ruby and Rails versions, see the Testing file.
This project uses Semantic Versioning.