Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sobot_module_Dev
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sobot_android
Sobot_module_Dev
Commits
1b7c68a9
Commit
1b7c68a9
authored
Jun 14, 2024
by
郭倩芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.2.8 解决日志内存溢出
parent
8135970d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
SobotCommonApi.java
.../src/main/java/com/sobot/common/utils/SobotCommonApi.java
+1
-1
SobotNetLogUtils.java
...ain/java/com/sobot/network/http/log/SobotNetLogUtils.java
+6
-0
No files found.
sobot_common/src/main/java/com/sobot/common/utils/SobotCommonApi.java
View file @
1b7c68a9
...
...
@@ -40,6 +40,6 @@ public class SobotCommonApi {
*/
public
static
void
setShowLogDebug
(
boolean
isDebug
)
{
SobotLogUtils
.
setShowDebug
(
isDebug
);
SobotNetLogUtils
.
setShowDebug
(
true
);
SobotNetLogUtils
.
setShowDebug
(
isDebug
);
}
}
sobot_network/src/main/java/com/sobot/network/http/log/SobotNetLogUtils.java
View file @
1b7c68a9
...
...
@@ -101,6 +101,12 @@ public class SobotNetLogUtils {
public
static
void
i
(
String
str
)
{
if
(
isDebug
&&
allowI
)
{
String
tag
=
generateTag
();
if
(
str
==
null
){
return
;
}
if
(
str
.
length
()>
4
*
MAX_LENGTH
){
str
=
str
.
substring
(
0
,
4
*
MAX_LENGTH
);
}
StringBuilder
content
=
new
StringBuilder
(
str
);
//采取分段打印日志的方法:当长度超过4000时,我们就来分段截取打印
if
(
content
.
length
()
>
MAX_LENGTH
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment