Skip to content

Commit

Permalink
🎨 调整日志级别
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jun 28, 2020
1 parent 5953341 commit 0d4efcd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
14 changes: 5 additions & 9 deletions src/main/java/org/b3log/solo/service/InitService.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* Solo initialization service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.5.2.42, Jun 16, 2020
* @version 1.5.2.43, Jun 28, 2020
* @since 0.4.0
*/
@Service
Expand Down Expand Up @@ -288,8 +288,6 @@ private void helloWorld() throws Exception {
comment.put(Comment.COMMENT_SHARP_URL, commentSharpURL);

commentRepository.add(comment);

LOGGER.info("Hello World!");
}

/**
Expand All @@ -313,10 +311,8 @@ private String addHelloWorldArticle(final JSONObject article) throws RepositoryE
articleRepository.add(article);
} catch (final RepositoryException e) {
LOGGER.log(Level.ERROR, "Adds an article failed", e);

throw new RepositoryException(e);
}

return ret;
}

Expand Down Expand Up @@ -417,7 +413,7 @@ private void initAdmin(final JSONObject requestJSONObject) throws Exception {
admin.put(UserExt.USER_GITHUB_ID, requestJSONObject.optString(UserExt.USER_GITHUB_ID));
userRepository.add(admin);

LOGGER.info("Initialized admin");
LOGGER.debug("Initialized admin");
}

/**
Expand All @@ -436,7 +432,7 @@ private void initLink() throws Exception {
final int maxOrder = linkRepository.getMaxOrder();
link.put(Link.LINK_ORDER, maxOrder + 1);
linkRepository.add(link);
LOGGER.info("Initialized link");
LOGGER.debug("Initialized link");
}

/**
Expand All @@ -454,7 +450,7 @@ private void initStatistic() throws RepositoryException, JSONException {
statisticBlogViewCountOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_STATISTIC);
optionRepository.add(statisticBlogViewCountOpt);

LOGGER.info("Initialized statistic");
LOGGER.debug("Initialized statistic");
}

/**
Expand Down Expand Up @@ -736,6 +732,6 @@ private void initOptions(final JSONObject requestJSONObject) throws Exception {
mobileSkinDirNameOpt.put(Option.OPTION_VALUE, DefaultPreference.DEFAULT_MOBILE_SKIN_DIR_NAME);
optionRepository.add(mobileSkinDirNameOpt);

LOGGER.info("Initialized preference");
LOGGER.debug("Initialized preference");
}
}
5 changes: 1 addition & 4 deletions src/test/java/org/b3log/solo/AbstractTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* Abstract test case.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 4.0.0.1, Apr 30, 2020
* @version 4.0.0.2, Jun 28, 2020
* @since 2.9.7
*/
public abstract class AbstractTestCase {
Expand All @@ -70,7 +70,6 @@ public abstract class AbstractTestCase {
*/
@BeforeClass
public void beforeClass() throws Exception {
System.out.println("before class");
beanManager = BeanManager.getInstance();

final Connection connection = Connections.getConnection();
Expand Down Expand Up @@ -113,9 +112,7 @@ private void initSolo() {
final JSONObject requestJSONObject = new JSONObject();
requestJSONObject.put(User.USER_NAME, "Solo");
requestJSONObject.put(UserExt.USER_B3_KEY, "pass");
System.out.println("before init");
initService.init(requestJSONObject);
System.out.println("after init");
final ErrorProcessor errorProcessor = beanManager.getReference(ErrorProcessor.class);
Dispatcher.error("/error/{statusCode}", errorProcessor::showErrorPage);
final UserQueryService userQueryService = getUserQueryService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* {@link ArticleProcessor} test case.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.1.4, Feb 22, 2019
* @version 1.0.1.5, Jun 28, 2020
* @since 1.7.0
*/
@Test(suiteName = "processor")
Expand Down Expand Up @@ -110,8 +110,8 @@ public void getAuthorsArticlesByPage() throws Exception {
@Test
public void getRandomArticles() {
final MockRequest request = mockRequest();
request.setRequestURI("/articles/random");
request.setMethod("POST");
request.setRequestURI("/articles/random.json");
request.setMethod("GET");
final MockResponse response = mockResponse();
mockDispatcher(request, response);

Expand Down

0 comments on commit 0d4efcd

Please sign in to comment.