Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0xcaffebabe/log
一个简单日志项目
https://github.com/0xcaffebabe/log
Last synced: about 1 month ago
JSON representation
一个简单日志项目
- Host: GitHub
- URL: https://github.com/0xcaffebabe/log
- Owner: 0xcaffebabe
- Created: 2019-01-20T07:15:48.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-06T10:35:27.000Z (almost 3 years ago)
- Last Synced: 2023-03-03T16:42:15.432Z (over 1 year ago)
- Language: Java
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# log
这是一个简单java 日志项目
#
2019-1-20启动了项目
#
2019-1-21第一个应用:
```java
public class LogTest {Log log = Log.getInstance(this.getClass());
@Test
public void run(){log.setDestination(new Destination(System.out,System.out));
log.info("测试输出:{1}",LocalDate.now());
log.error("错误输出:{1},{2}",Thread.currentThread(),LocalDate.now());log.setLogPrinter((log, level, msg) -> "["+level+"]\t"+msg+"\n");
System.out.println("----------------");
log.info("测试输出:{1}",LocalDate.now());
log.error("错误输出:{1},{2}",Thread.currentThread(),LocalDate.now());
}
}
```产生输出:
```text
2019-01-26T19:29:46.882238500 [INFO] wang.ismy.log.LogTest : 测试输出:2019-01-26
2019-01-26T19:29:46.884236500 [ERROR] wang.ismy.log.LogTest : 错误输出:Thread[main,5,main],2019-01-26
----------------
[INFO] 测试输出:2019-01-26
[ERROR] 错误输出:Thread[main,5,main],2019-01-26
```