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
b65e407c
Commit
b65e407c
authored
Jun 03, 2024
by
郭倩芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net 打印日志内存溢出
parent
64f2643e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
sobot-network-publish-mavencentral.gradle
sobot_network/sobot-network-publish-mavencentral.gradle
+1
-1
SobotNetLogUtils.java
...ain/java/com/sobot/network/http/log/SobotNetLogUtils.java
+3
-2
No files found.
sobot_network/sobot-network-publish-mavencentral.gradle
View file @
b65e407c
...
...
@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
ext
{
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'net'
//项目名
PUBLISH_VERSION
=
'1.2.
5
'
//版本号
PUBLISH_VERSION
=
'1.2.
6
'
//版本号
}
...
...
sobot_network/src/main/java/com/sobot/network/http/log/SobotNetLogUtils.java
View file @
b65e407c
...
...
@@ -98,9 +98,10 @@ public class SobotNetLogUtils {
//分段打印日志每次最大长度
private
static
final
int
MAX_LENGTH
=
3
*
1024
;
public
static
void
i
(
String
content
)
{
public
static
void
i
(
String
str
)
{
if
(
isDebug
&&
allowI
)
{
String
tag
=
generateTag
();
StringBuilder
content
=
new
StringBuilder
(
str
);
//采取分段打印日志的方法:当长度超过4000时,我们就来分段截取打印
if
(
content
.
length
()
>
MAX_LENGTH
)
{
String
part
=
content
.
substring
(
0
,
MAX_LENGTH
);
...
...
@@ -114,7 +115,7 @@ public class SobotNetLogUtils {
}
}
else
{
//直接打印
Log
.
i
(
tag
,
content
);
Log
.
i
(
tag
,
str
);
}
}
}
...
...
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