Skip to content

Commit

Permalink
Add back and fix log flags in sidecar (#452)
Browse files Browse the repository at this point in the history
* Add log flags back to sidecar

* Fix missing arg values being passed to the sidecar

* Fix main command log args duplication

* Replace sidecar with --sidecar instead of inserting log flags manually

* Move --sidecar to the start and always add --log

* Remove --log from sidecar params

* Add --key and --mem to main command flags

* Hide --key and --mem flags
  • Loading branch information
jkcdarunday authored Nov 20, 2024
1 parent b65bd5b commit 465a9e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cmd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => {
description(usage.descriptions.sidecar),
flag('--mem', 'Memory mode: RAM corestore'),
flag('--key <key>', 'Advanced. Switch release lines'),
flag('--log-level <level>', 'Level to log at. 0,1,2,3 (OFF,ERR,INF,TRC)'),
flag('--log-labels <list>', 'Labels to log (internal, always logged)'),
flag('--log-fields <list>', 'Show/hide: date,time,h:level,h:label,h:delta'),
flag('--log-stacks', 'Add a stack trace to each log message'),
flag('--dht-bootstrap <nodes>').hide(),
runners.sidecar(ipc)
)
Expand Down
4 changes: 3 additions & 1 deletion cmd/sidecar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ module.exports = (ipc) => async function sidecar (cmd) {
if (cmd.flags.mem) print(ansi.green('Memory Mode On') + ansi.gray(' [ --mem ]'), 0)
print('\n========================= INIT ===================================\n')

Bare.argv.splice(1, 0, '--log', ...Bare.argv.filter((arg) => arg.startsWith('--log')))
Bare.argv.splice(Bare.argv.indexOf('sidecar'), 1)
Bare.argv.splice(1, 0, '--sidecar', '--log')

require('../sidecar')

print('\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n')
Expand Down
2 changes: 2 additions & 0 deletions def/pear.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ module.exports = [
flag('--run').hide(), // appling legacy
flag('--sandbox').hide(), // appling legacy
flag('--appling').hide(), // appling legacy
flag('--key <key>', 'Advanced. Switch release lines').hide(),
flag('--mem', 'Memory mode: RAM corestore').hide(),
flag('--dht-bootstrap <nodes>').hide()
]

0 comments on commit 465a9e2

Please sign in to comment.