File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2
2
import os
3
3
import threading
4
4
from loguru import logger
5
+ from datetime import datetime
5
6
6
7
from graia .ariadne .event .lifecycle import ApplicationLaunched
7
8
from graia .ariadne .event .message import Group , Member , MessageChain , Friend
18
19
saya = core .get_saya ()
19
20
config = core .get_config ()
20
21
22
+ if not os .path .exists (f"{ os .getcwd ()} /log/{ datetime .now ().strftime ('%Y-%m-%d' )} " ):
23
+ os .mkdir (f"{ os .getcwd ()} /log/{ datetime .now ().strftime ('%Y-%m-%d' )} " )
24
+
21
25
logger .add (
22
- f"{ os .getcwd ()} /log/common.log" ,
26
+ f"{ os .getcwd ()} /log/{ datetime . now (). strftime ( '%Y-%m-%d' ) } / common.log" ,
23
27
level = "INFO" ,
24
28
retention = f"{ config .log_related ['common_retention' ]} days" ,
25
29
encoding = "utf-8"
26
30
)
27
31
logger .add (
28
- f"{ os .getcwd ()} /log/error.log" ,
32
+ f"{ os .getcwd ()} /log/{ datetime . now (). strftime ( '%Y-%m-%d' ) } / error.log" ,
29
33
level = "ERROR" ,
30
34
retention = f"{ config .log_related ['error_retention' ]} days" ,
31
35
encoding = "utf-8"
You can’t perform that action at this time.
0 commit comments