检查 logpath 入参
This commit is contained in:
parent
dcd4b91b57
commit
d950ae74db
@ -1,6 +1,6 @@
|
|||||||
# 应用配置
|
# 应用配置
|
||||||
# 调试模式 (true/false)
|
# 调试模式 (true/false)
|
||||||
debug=false
|
debug=true
|
||||||
|
|
||||||
# 地址列表 (格式: addX=ip:port)
|
# 地址列表 (格式: addX=ip:port)
|
||||||
addr1=172.1.41.129:8889
|
addr1=172.1.41.129:8889
|
||||||
|
|||||||
@ -62,7 +62,7 @@ public class LogFactory {
|
|||||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
// 日志打印方式——输出为文件
|
// 日志打印方式——输出为文件
|
||||||
Appender appender = FileAppender.createAppender(
|
Appender appender = FileAppender.createAppender(
|
||||||
String.format( pcLogPath +"sydapi_"+ format.format(new Date()) + ".log"),
|
String.format( pcLogPath + "sydapi_"+ format.format(new Date()) + ".log"),
|
||||||
"true", "false",
|
"true", "false",
|
||||||
logName, null, "true", "true", null, layout, null, null, null, config);
|
logName, null, "true", "true", null, layout, null, null, null, config);
|
||||||
|
|
||||||
@ -96,6 +96,13 @@ public class LogFactory {
|
|||||||
* @return Logger
|
* @return Logger
|
||||||
*/
|
*/
|
||||||
public static Logger createLogger(String pcLogPath, int iLogLevel) {
|
public static Logger createLogger(String pcLogPath, int iLogLevel) {
|
||||||
|
if( null == pcLogPath || pcLogPath.trim().equals("") ) {
|
||||||
|
pcLogPath = "./";
|
||||||
|
}
|
||||||
|
if( ! pcLogPath.endsWith("/") ) {
|
||||||
|
pcLogPath = pcLogPath + "/";
|
||||||
|
}
|
||||||
|
|
||||||
LogFactory.pcLogPath = pcLogPath;
|
LogFactory.pcLogPath = pcLogPath;
|
||||||
LogFactory.iLogLevel = iLogLevel;
|
LogFactory.iLogLevel = iLogLevel;
|
||||||
start();
|
start();
|
||||||
|
|||||||
@ -111,12 +111,14 @@ public class TestAll {
|
|||||||
|
|
||||||
switch (choise.getAsInt()) {
|
switch (choise.getAsInt()) {
|
||||||
case 1:
|
case 1:
|
||||||
|
SydApi.SYD_SetLogConfig("./logs", 3);
|
||||||
funcMenu(config, choise, test);
|
funcMenu(config, choise, test);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
test.funcAll();
|
test.funcAll();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
SydApi.SYD_SetLogConfig("./logs", 0);
|
||||||
perfMenu(config, choise, test);
|
perfMenu(config, choise, test);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
@ -1212,7 +1214,7 @@ public class TestAll {
|
|||||||
public static void funcMenu(Config config, Choise choise, TestAll test) throws Exception{
|
public static void funcMenu(Config config, Choise choise, TestAll test) throws Exception{
|
||||||
|
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
|
SydApi.SYD_SetLogConfig("./logs", 3);
|
||||||
while (flag) {
|
while (flag) {
|
||||||
System.out.println("请选择测试项:");
|
System.out.println("请选择测试项:");
|
||||||
System.out.println("1. 日志测试");
|
System.out.println("1. 日志测试");
|
||||||
@ -1397,4 +1399,10 @@ public class TestAll {
|
|||||||
menu1(config, choise, test);
|
menu1(config, choise, test);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void testComm(){
|
||||||
|
String hex = "0436000000000000000E453030383130534B303030303030303030303030303030303030413030303030303030303031303030303234303000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user