Bugfix lhs_log_ext and add IsCreated to public modul

This commit is contained in:
René Linder 2021-05-24 14:45:58 +02:00
parent 606f5159d4
commit 7ab2255ff0

View file

@ -65,7 +65,7 @@ DeclareModule lhs_log_ext
#Warning #Warning
#Error #Error
EndEnumeration EndEnumeration
Declare IsCreated(UUID.s)
Declare SetLogFile(UUID.s, LogFileName.s) Declare SetLogFile(UUID.s, LogFileName.s)
Declare SetMaxSize(UUID.s, Megabyte.i) Declare SetMaxSize(UUID.s, Megabyte.i)
Declare SetLogLevel(UUID.s, Level.i) Declare SetLogLevel(UUID.s, Level.i)
@ -86,7 +86,7 @@ Module lhs_log_ext
Procedure.s Create(Name.s) Procedure.s Create(Name.s)
Define.s InternalUUID Define.s InternalUUID
If Len(Name) > 0 And LockMutex(CreateLoggerMutex) If Len(Name) > 0 And TryLockMutex(CreateLoggerMutex)
InternalUUID = CreateUUID() InternalUUID = CreateUUID()
AddElement(LoggerUUID()) AddElement(LoggerUUID())
LoggerUUID() = InternalUUID LoggerUUID() = InternalUUID
@ -104,9 +104,7 @@ Module lhs_log_ext
Logger(InternalUUID)\LogDateFormat.s = "%yyyy.%mm.%dd %hh:%ii:%ss" Logger(InternalUUID)\LogDateFormat.s = "%yyyy.%mm.%dd %hh:%ii:%ss"
UnlockMutex(CreateLoggerMutex) UnlockMutex(CreateLoggerMutex)
ProcedureReturn InternalUUID ProcedureReturn InternalUUID
EndIf EndIf
UnlockMutex(CreateLoggerMutex)
EndProcedure EndProcedure
Procedure IsCreated(UUID.s) Procedure IsCreated(UUID.s)