Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log Command #28

Merged
merged 5 commits into from
Jun 14, 2024
Merged

Log Command #28

merged 5 commits into from
Jun 14, 2024

Conversation

msaxon
Copy link
Collaborator

@msaxon msaxon commented Jun 13, 2024

Changes

  • added a new log command that follows the pattern in the API docs.

Tested By

  • Ran the command with an active process and watched it tail the process.
  • Ran the command with a dead process and watched it read the last N lines

Logs

go run ./cmd/run.go log
NAME:
   hathora log - view live process logs

USAGE:
   hathora log [command [command options]] [arguments...]

COMMANDS:
   help, h  Shows a list of commands or help for one command

OPTIONS:
   --help, -h  show help (default: false)

   Global:

   --app-id <id>, -a <id>                     the <id> of the app in Hathora [$HATHORA_APP_ID]
   --config <path>, -c <path>                 <path> to the configuration file
   --hathora-cloud-endpoint <url>             override the default API base <url> (default: https://api.hathora.dev) [$HATHORA_CLOUD_ENDPOINT]
   --output <format>, -o <format>             the <format> of the output. Supported values: (json, text, value=buildId) (default: "text") [$HATHORA_OUTPUT]
   --pretty                                   enable pretty output (json only) (default: true)
   --token <access-token>, -t <access-token>  <access-token> for authenticating with the API [$HATHORA_TOKEN]
   --verbose, -v                              enable verbose logging (default: false)
   --verbosity <level>                        set the logging verbosity <level> (0-3) (default: 0) [$HATHORA_VERBOSITY]

   Log:

   --follow                      to streams logs in real time (default: false) [$HATHORA_LOG_FOLLOW]
   --process-id value, -p value  system generated unique identifier to a runtime instance of your game server [$HATHORA_LOG_PROCESS_ID]
   --tail-lines value            number of lines to return from most recent logs history. [$HATHORA_BUILD_TAIL_LINES]

internal/commands/log.go Outdated Show resolved Hide resolved
internal/commands/log.go Outdated Show resolved Hide resolved
internal/commands/log.go Outdated Show resolved Hide resolved
@msaxon msaxon marked this pull request as ready for review June 14, 2024 21:34
internal/commands/log.go Outdated Show resolved Hide resolved
internal/commands/log.go Outdated Show resolved Hide resolved
internal/commands/log.go Outdated Show resolved Hide resolved
internal/commands/log.go Outdated Show resolved Hide resolved
internal/commands/log.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@drewfead drewfead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions for cleanup but looking very nice

@msaxon msaxon merged commit 179c255 into main Jun 14, 2024
13 checks passed
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.

None yet

2 participants