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

Add logs command line opt #1515

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Bengali, Catalan, Greek and Serbian translations
- it is not possible to close app during break that is in strict mode
- `logs` command line option to show location of logs

### Fixed
- error when end break shortcut is not set
Expand Down
13 changes: 12 additions & 1 deletion app/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ const allCommands = {
description: 'Show this help message'
},
version: {
description: 'Show current stretchly version'
description: 'Show current Stretchly version'
},
logs: {
description: 'Show location of logs file'
},
reset: {
description: 'Reset breaks'
Expand Down Expand Up @@ -179,6 +182,10 @@ class Command {
this.ver()
break

case 'logs':
this.logs()
break

default:
if (this.hasSupportedCommand) {
log.info(`Stretchly${this.isFirstInstance ? '' : ' 2'}: forwarding command '${this.command}' to the main instance`)
Expand Down Expand Up @@ -227,6 +234,10 @@ class Command {
console.log(`Stretchly version ${this.version}`)
}

logs () {
console.log(log.transports.file.getFile().path)
}

cmdHelp () {
let i = 0
const options = '[options]'
Expand Down
Loading