mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
♻️ 日志组件单独抽取项目 https://github.com/siyuan-note/siyuan/issues/5439
This commit is contained in:
parent
c8ea858976
commit
505b973c2d
70 changed files with 671 additions and 942 deletions
|
|
@ -26,6 +26,7 @@ import (
|
|||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/conf"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
|
|
@ -38,7 +39,7 @@ func getEmojiConf(c *gin.Context) {
|
|||
builtConfPath := filepath.Join(util.AppearancePath, "emojis", "conf.json")
|
||||
data, err := os.ReadFile(builtConfPath)
|
||||
if nil != err {
|
||||
util.LogErrorf("read emojis conf.json failed: %s", err)
|
||||
logging.LogErrorf("read emojis conf.json failed: %s", err)
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
|
|
@ -46,7 +47,7 @@ func getEmojiConf(c *gin.Context) {
|
|||
|
||||
var conf []map[string]interface{}
|
||||
if err = gulu.JSON.UnmarshalJSON(data, &conf); nil != err {
|
||||
util.LogErrorf("unmarshal emojis conf.json failed: %s", err)
|
||||
logging.LogErrorf("unmarshal emojis conf.json failed: %s", err)
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
|
|
@ -64,7 +65,7 @@ func getEmojiConf(c *gin.Context) {
|
|||
model.CustomEmojis = sync.Map{}
|
||||
customEmojis, err := os.ReadDir(customConfDir)
|
||||
if nil != err {
|
||||
util.LogErrorf("read custom emojis failed: %s", err)
|
||||
logging.LogErrorf("read custom emojis failed: %s", err)
|
||||
} else {
|
||||
for _, customEmoji := range customEmojis {
|
||||
name := customEmoji.Name()
|
||||
|
|
@ -76,7 +77,7 @@ func getEmojiConf(c *gin.Context) {
|
|||
// 子级
|
||||
subCustomEmojis, err := os.ReadDir(filepath.Join(customConfDir, name))
|
||||
if nil != err {
|
||||
util.LogErrorf("read custom emojis failed: %s", err)
|
||||
logging.LogErrorf("read custom emojis failed: %s", err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue