hexabase-cli is a command line tool to manupulate Hexabase resource and services.
$ npm install -g hexabase-cli
アクセス環境はcontextと呼ばれる単位で管理されます。 ここでは、利用している開発環境を指定し、stgと命名します。
server: API Server URL sse: eventServer URL <-- server からの通知を受け取るためのPub/Sub providerです。
$ hx contexts:set stg --server=https://az-api.hexabase.com --sse=https://az-sse.hexabase.com
以下のコマンドで正しく設定されていることを確認します。
$ hx contexts:get
NAME SERVER SSE
stg https://az-api.hexabase.com https://az-sse.hexabase.com
$ hx contexts:login
ダイアログ質問に答えていき、ログインします。
? Enter your email » h.iwasaki@b-eee.com
? Enter your password » xxxxx
Successfully logged in as: h.iwasaki@b-eee.com
画面中のデータのu_id, p_id を組み合わせてサブスクライブchannelを指定します。
USAGE:
hx logs:actionscript CHANNEL #CHANNEL format = logs_<u_id>_<p_id>
ログの購読開始
$ hx logs:actionscript logs_5afeb66813ac8000078354c7_5f52598ae2fb440001214119
Listening for logs...
ActionScript内にて、以下5種類のログ出力関数を利用できます
function main(data) {
logger.debug("debug....");
logger.info("some info");
logger.debug("warning!");
logger.error("ERROR!!!");
logger.log("---- log output ---");
}
「試行」を押下すると、 CLIコンソール内に、以下のようにログが出力されます
[DEBUG] debug....
[INFO] some info
[DEBUG] warning!
[ERROR] ERROR!!!
---- log output ---
- ログの購読は、「試行」ボタン押下時のみ、確認できます。APIからの実行やアクション実行時にはログは出力されません。