Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
ae8d6e0c
Commit
ae8d6e0c
authored
May 21, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix doc and DefaultLogger usage
parent
f8484732
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt
.../mirai/qqandroid/network/protocol/packet/PacketFactory.kt
+3
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/MiraiLogger.kt
...rc/commonMain/kotlin/net.mamoe.mirai/utils/MiraiLogger.kt
+9
-3
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/PlatformLogger.jvm.kt
...vmMain/kotlin/net/mamoe/mirai/utils/PlatformLogger.jvm.kt
+1
-2
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt
View file @
ae8d6e0c
...
...
@@ -122,7 +122,9 @@ internal typealias PacketConsumer<T> = suspend (packetFactory: PacketFactory<T>,
* 它默认是关闭的.
*/
@PublishedApi
internal
val
PacketLogger
:
MiraiLoggerWithSwitch
=
DefaultLogger
(
"Packet"
).
withSwitch
(
false
)
internal
val
PacketLogger
:
MiraiLoggerWithSwitch
by
lazy
{
DefaultLogger
(
"Packet"
).
withSwitch
(
false
)
}
internal
object
KnownPacketFactories
{
object
OutgoingFactories
:
List
<
OutgoingPacketFactory
<
*
>>
by
mutableListOf
(
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/MiraiLogger.kt
View file @
ae8d6e0c
...
...
@@ -211,17 +211,23 @@ inline fun MiraiLogger.error(lazyMessage: () -> String?, e: Throwable?) {
* 在 _JVM 控制台_ 端的实现为 [println]
* 在 _Android_ 端的实现为 `android.util.Log`
*
* 不应该直接构造这个类的实例. 请使用 [DefaultLogger]
*
*
* 单条日志格式 (正则) 为:
* ```regex
* ^([\w-]*\s[\w:]*)\s
\[(\w\])\s
(.*?):\s(.+)$
* ^([\w-]*\s[\w:]*)\s
(\w)\/
(.*?):\s(.+)$
* ```
* 其中 group 分别为: 日期与时间, 严重程度, [identity], 消息内容.
*
* 示例:
* ```log
* 2020-05-21 19:51:09 V/Bot 1994701021: Send: OidbSvc.0x88d_7
* ```
*
* 日期时间格式为 `yyyy-MM-dd HH:mm:ss`,
*
* 严重程度为 V, I, W, E. 分别对应 verbose, info, warning, error
*
* @see DefaultLogger
*/
expect
open
class
PlatformLogger
@JvmOverloads
constructor
(
identity
:
String
?
=
"Mirai"
)
:
MiraiLoggerPlatformBase
...
...
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/PlatformLogger.jvm.kt
View file @
ae8d6e0c
...
...
@@ -21,8 +21,6 @@ import java.util.*
/**
* JVM 控制台日志实现
*
* 不应该直接构造这个类的实例. 请使用 [DefaultLogger]
*
*
* 单条日志格式 (正则) 为:
* ```regex
...
...
@@ -41,6 +39,7 @@ import java.util.*
*
* @param isColored 是否添加 ANSI 颜色
*
* @see DefaultLogger
* @see SingleFileLogger 使用单一文件记录日志
* @see DirectoryLogger 在一个目录中按日期存放文件记录日志, 自动清理过期日志
*/
...
...
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