0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

chaliceコマンドのデバッグ出力を行う

Last updated at Posted at 2020-05-04

chalice コマンドを見てみると、デバッグオプションはちゃんとあるのに、

$ chalice --help
Usage: chalice [OPTIONS] COMMAND [ARGS]...

Options:
  --version             Show the version and exit.
  --project-dir TEXT    The project directory path (absolute or
                        relative).Defaults to CWD

  --debug / --no-debug  Print debug logs to stderr.
  --help                Show this message and exit.

Commands:
  delete
  deploy
  dev                Development and debugging commands for chalice.
  gen-policy
  generate-models    Generate a model from Chalice routes.
  generate-pipeline  Generate a cloudformation template for a starter CD...
  generate-sdk
  invoke             Invoke the deployed lambda function NAME.
  local
  logs
  new-project
  package
  url

以下のようにすると、怒られてしまう、、、

怒られる
$ chalice package build --debug
Usage: chalice package [OPTIONS] OUT
Try 'chalice package --help' for help.

Error: no such option: --debug

どうも、調べるとオプションを渡す場合はサブコマンドの前に渡す必要があるらしい。

というか、最初のをよく見ると chalice [OPTIONS] COMMAND [ARGS] となっており、--debugOPTIONS の一覧なので、ここにセットしないとダメですね…。

これならOK
$ chalice --debug package build
2020-05-04 19:16:44,435 botocore.hooks [DEBUG] Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2020-05-04 19:16:44,440 botocore.hooks [DEBUG] Changing event name from before-call.apigateway to before-call.api-gateway
2020-05-04 19:16:44,441 botocore.hooks [DEBUG] Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2020-05-04 19:16:44,443 botocore.hooks [DEBUG] Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2020-05-04 19:16:44,443 botocore.hooks [DEBUG] Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2020-05-04 19:16:44,444 botocore.hooks [DEBUG] Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
(後略)

chalice package --stage local のように、 ARGS-- 始まりの引数を渡すことがあったので、オプションが明確に分かれていることに気づきませんでした、というお話です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?