-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,019 additions
and
272 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Arguments, Argv } from 'yargs'; | ||
import { LogLevel, SetLogLevelRequest } from '../../proto/xudrpc_pb'; | ||
import { callback, loadXudClient } from '../command'; | ||
import { LevelPriority } from '../../Logger'; | ||
|
||
export const command = 'loglevel <level>'; | ||
|
||
export const describe = 'set the logging level for xud'; | ||
|
||
export const builder = (argv: Argv) => argv | ||
.positional('level', { | ||
description: 'the logging level', | ||
type: 'string', | ||
choices: ['alert', 'error', 'warn', 'verbose', 'info', 'debug', 'trace'], | ||
coerce: (logLevelStr: string) => { | ||
const logLevelLower = logLevelStr.toLowerCase(); | ||
return logLevelLower; | ||
}, | ||
}) | ||
.example('$0 loglevel trace', 'set log level to trace') | ||
.example('$0 loglevel info', 'set log level to info'); | ||
|
||
export const handler = async (argv: Arguments<any>) => { | ||
const request = new SetLogLevelRequest(); | ||
const levelPriority = LevelPriority[argv.level] as unknown as number; | ||
const logLevel: LogLevel = levelPriority as LogLevel; | ||
request.setLogLevel(logLevel); | ||
(await loadXudClient(argv)).setLogLevel(request, callback(argv)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.