Skip to content

add set log level handler for setting log level from vscode side. - #47

Merged
Andy Xu(devdiv) (andxu) merged 4 commits into
masterfrom
andy_log
Sep 25, 2017
Merged

add set log level handler for setting log level from vscode side.#47
Andy Xu(devdiv) (andxu) merged 4 commits into
masterfrom
andy_log

Conversation

@andxu

Copy link
Copy Markdown
Contributor

No description provided.

@msftclas

Andy Xu(devdiv) (@andxu),
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

if (arguments != null && arguments.size() == 1 && arguments.get(0) instanceof String) {
try {
logger.setLevel(Level.parse((String) arguments.get(0)));
logger.warning(String.format("Set log level to : %s", arguments.get(0)));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why is this a warning?
info is enough to tell the user the log level is set to whatever they specified.

logger.warning(String.format("Set log level to : %s", arguments.get(0)));
return logger.getLevel().toString();
} catch (IllegalArgumentException e) {
logger.warning(String.format("Invalid log level: %s", arguments.get(0)));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should be an error.

}

} else {
logger.warning(String.format("Invalid parameters for configLogLevel: %s", StringUtils.join(arguments)));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should be an error.

@andxu
Andy Xu(devdiv) (andxu) merged commit 0efb623 into master Sep 25, 2017
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.

4 participants