@@ -176,6 +176,23 @@ CleanOldLogs() {
176176 }
177177}
178178
179+ CleanMisPlacedConfigs () {
180+ shared := RabbitSharedDataPath()
181+ user := RabbitUserDataPath()
182+
183+ if shared == user
184+ return
185+
186+ if FileExist (user . " \default.yaml" ) {
187+ RabbitWarn(Format (" renaming unnecessary file {}\default.yaml" , user), Format (" RabbitCommon.ahk:{}" , A_LineNumber ))
188+ FileMove (user . " \default.yaml" , user . " \default.yaml.old" , 1 )
189+ }
190+ if FileExist (user . " \rabbit.yaml" ) {
191+ RabbitWarn(Format (" renaming unnecessary file {}\rabbit.yaml" , user), Format (" RabbitCommon.ahk:{}" , A_LineNumber ))
192+ FileMove (user . " \rabbit.yaml" , user . " \rabbit.yaml.old" , 1 )
193+ }
194+ }
195+
179196RabbitLog (text ) {
180197 try {
181198 FileAppend (text , " *" , " UTF-8" )
@@ -194,6 +211,10 @@ RabbitError(text, location, limit := -1) {
194211 msg := Format (" E{} {:5} {}] {}`r`n" , FormatTime (, " yyyyMMdd HH:mm:ss " ), ProcessExist(), location, text )
195212 RabbitLogLimit(msg, location, limit )
196213}
214+ RabbitWarn (text, location, limit := -1 ) {
215+ msg := Format (" W{} {:5} {}] {}`r`n" , FormatTime (, " yyyyMMdd HH:mm:ss " ), ProcessExist(), location, text )
216+ RabbitLogLimit(msg, location, limit )
217+ }
197218RabbitInfo (text, location, limit := -1 ) {
198219 msg := Format (" I{} {:5} {}] {}`r`n" , FormatTime (, " yyyyMMdd HH:mm:ss " ), ProcessExist(), location, text )
199220 RabbitLogLimit(msg, location, limit )
0 commit comments