@ -73,11 +73,11 @@ init(Opts) ->
% % 需 要 二 次 转 换 的 配 置 在 这 里 处 理
Level = lgUtil : configToMask ( CfgLevel ) ,
SyncOn = lgUtil : configToMask ( CfgSyncOn ) ,
CheckInt = ?
IIF ( CfgCheckInt == always , 0 , CfgCheckInt ) ,
CheckInt = ? lg IIF( CfgCheckInt == always , 0 , CfgCheckInt ) ,
{ ok , Date } = lgUtil : parseRotateSpec ( CfgDate ) ,
FileName = lgUtil : parsePath ( FBName ) ,
scheduleRotation ( Date , FBName ) ,
FmtCfg = ?
IIF ( CfgFmtCfg =/= [ ] , CfgFmtCfg , begin MdWhitelist = lgUtil : get_env ( mdWhitelist , [ ] ) , lgFmtTer : fmtCfg ( MdWhitelist ) end ) ,
FmtCfg = ? lg IIF( CfgFmtCfg =/= [ ] , CfgFmtCfg , begin MdWhitelist = lgUtil : get_env ( mdWhitelist , [ ] ) , lgFmtTer : fmtCfg ( MdWhitelist ) end ) ,
Shaper = #lgShaper { hwm = Hwm , flushQueue = FlushQueue , flushThr = FlushThr , id = FBName } ,
TemState = #state {
@ -199,7 +199,7 @@ writeLog(#state{fileName = FileName, fd = Fd, inode = Inode, cTime = CTime, flap
writeFile ( NewState , Level , Msg )
end ;
{ error , Reason } - >
?
IIF ( Flap , State , begin ? INT_LOG ( ? llvError , < < " Failed to reopen log file ~ ts with error ~s " > > , [ FileName , file : format_error ( Reason ) ] ) , State #state { flap = true } end )
? lg IIF( Flap , State , begin ? INT_LOG ( ? llvError , < < " Failed to reopen log file ~ ts with error ~s " > > , [ FileName , file : format_error ( Reason ) ] ) , State #state { flap = true } end )
end ;
_ - >
writeFile ( State , Level , Msg )
@ -252,11 +252,11 @@ configToId(Config) ->
end .
checkOpts ( [ ] , IsFile ) - >
?
IIF ( IsFile , true , { error , no_file_name } ) ;
? lg IIF( IsFile , true , { error , no_file_name } ) ;
checkOpts ( [ { file , _ File } | Tail ] , _ IsFile ) - >
checkOpts ( Tail , true ) ;
checkOpts ( [ { level , Level } | Tail ] , IsFile ) - >
?
IIF ( lgUtil : validateLogLevel ( Level ) =/= false , checkOpts ( Tail , IsFile ) , { error , { invalid_log_level , Level } } ) ;
? lg IIF( lgUtil : validateLogLevel ( Level ) =/= false , checkOpts ( Tail , IsFile ) , { error , { invalid_log_level , Level } } ) ;
checkOpts ( [ { size , Size } | Tail ] , IsFile ) when is_integer ( Size ) , Size > = 0 - >
checkOpts ( Tail , IsFile ) ;
checkOpts ( [ { count , Count } | Tail ] , IsFile ) when is_integer ( Count ) , Count > = 0 - >
@ -274,7 +274,7 @@ checkOpts([{syncSize, SyncSize} | Tail], IsFile) when is_integer(SyncSize), Sync
checkOpts ( [ { checkInt , CheckInt } | Tail ] , IsFile ) when is_integer ( CheckInt ) , CheckInt > = 0 ; CheckInt == always - >
checkOpts ( Tail , IsFile ) ;
checkOpts ( [ { syncOn , Level } | Tail ] , IsFile ) - >
?
IIF ( lgUtil : validateLogLevel ( Level ) =/= false , checkOpts ( Tail , IsFile ) , { error , { invalid_sync_on , Level } } ) ;
? lg IIF( lgUtil : validateLogLevel ( Level ) =/= false , checkOpts ( Tail , IsFile ) , { error , { invalid_sync_on , Level } } ) ;
checkOpts ( [ { fmtTer , Fmt } | Tail ] , IsFile ) when is_atom ( Fmt ) - >
checkOpts ( Tail , IsFile ) ;
checkOpts ( [ { fmtCfg , FmtCfg } | Tail ] , IsFile ) when is_list ( FmtCfg ) - >