gpt4 book ai didi

java - 在 Java Visual Studio Code 调试器中隐藏 API 请求 (YahooFinance)

转载 作者:太空宇宙 更新时间:2023-11-04 10:02:18 24 4
gpt4 key购买 nike

我无法删除调试器终端中的橙色 java API 请求。我想隐藏这些。我该怎么做呢? (见图)

我正在使用带有 Maven 的 Visual Studio Code。

Printscreen

我的代码片段:

        try {


Calendar from = Calendar.getInstance();
Calendar to = Calendar.getInstance();
from.add(Calendar.YEAR, -1); // from 1 year ago 
Stock stock = YahooFinance.get("GOOG");
List<HistoricalQuote> stockHistQuotes = stock.getHistory(from, to, Interval.DAILY);

}

catch(Exception e) {}

输出:

Hello World!
358 [main] INFO yahoofinance.quotes.query1v7.QuotesRequest - Sending request: https://query1.finance.yahoo.com/v7/finance/quote?symbols=GOOG
3687 [main] INFO yahoofinance.histquotes2.HistQuotes2Request - Sending request: https://query1.finance.yahoo.com/v7/finance/download/GOOG?period1=1510830000&period2=1542366000&interval=1d&crumb=FlUQht4hFF9
3756 [main] INFO yahoofinance.histquotes2.HistQuotes2Request - Parsing CSV line: 2017-11-16,1022.520020,1035.920044,1022.520020,1032.500000,1032.500000,1129700
3758 [main] INFO yahoofinance.histquotes2.HistQuotes2Request - Parsing CSV line: 2017-11-17,1034.010010,1034.420044,1017.750000,1019.090027,1019.090027,1397100
3758 [main] INFO yahoofinance.histquotes2.HistQuotes2Request - Parsing CSV line: 2017-11-20,1020.260010,1022.609985,1017.500000,1018.380005,1018.380005,953500

除了 Hello World 之外的所有内容都应该被删除。

最佳答案

谢谢,我用这行代码解决了这个问题:

Configurator.setRootLevel(Level.FATAL);

并将我在 Maven 中的依赖项更改为:

 <exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.11.1</version>
</dependency>

关于java - 在 Java Visual Studio Code 调试器中隐藏 API 请求 (YahooFinance),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53339604/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com