@@ -233,7 +233,7 @@ public virtual bool SetResult(PhysicalConnection connection, Message message, in
233233 {
234234 try
235235 {
236- logging . Log ? . LogInformation ( $ "Response from { bridge ? . Name } / { message . CommandAndKey } : { result } " ) ;
236+ logging . Log ? . LogInformationResponse ( bridge ? . Name , message . CommandAndKey , result ) ;
237237 }
238238 catch { }
239239 }
@@ -816,7 +816,7 @@ public override bool SetResult(PhysicalConnection connection, Message message, i
816816 if ( bridge != null )
817817 {
818818 var server = bridge . ServerEndPoint ;
819- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured role: replica" ) ;
819+ Log ? . LogInformationAutoConfiguredRoleReplica ( new ( server ) ) ;
820820 server . IsReplica = true ;
821821 }
822822 }
@@ -837,7 +837,7 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
837837 if ( result . TryGetInt64 ( out long clientId ) )
838838 {
839839 connection . ConnectionId = clientId ;
840- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (CLIENT) connection-id: { clientId } " ) ;
840+ Log ? . LogInformationAutoConfiguredClientConnectionId ( new ( server ) , clientId ) ;
841841
842842 SetResult ( message , true ) ;
843843 return true ;
@@ -871,7 +871,7 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
871871 if ( TryParseRole ( val , out bool isReplica ) )
872872 {
873873 server . IsReplica = isReplica ;
874- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (INFO) role: { ( isReplica ? "replica" : "primary" ) } ") ;
874+ Log ? . LogInformationAutoConfiguredInfoRole ( new ( server ) , isReplica ? "replica" : "primary" ) ;
875875 }
876876 }
877877 else if ( ( val = Extract ( line , "master_host:" ) ) != null )
@@ -887,15 +887,15 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
887887 if ( Format . TryParseVersion ( val , out Version ? version ) )
888888 {
889889 server . Version = version ;
890- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (INFO) version: " + version ) ;
890+ Log ? . LogInformationAutoConfiguredInfoVersion ( new ( server ) , version ) ;
891891 }
892892 }
893893 else if ( ( val = Extract ( line , "redis_mode:" ) ) != null )
894894 {
895895 if ( TryParseServerType ( val , out var serverType ) )
896896 {
897897 server . ServerType = serverType ;
898- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (INFO) server-type: { serverType } " ) ;
898+ Log ? . LogInformationAutoConfiguredInfoServerType ( new ( server ) , serverType ) ;
899899 }
900900 }
901901 else if ( ( val = Extract ( line , "run_id:" ) ) != null )
@@ -913,7 +913,7 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
913913 else if ( message ? . Command == RedisCommand . SENTINEL )
914914 {
915915 server . ServerType = ServerType . Sentinel ;
916- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (SENTINEL) server-type: sentinel" ) ;
916+ Log ? . LogInformationAutoConfiguredSentinelServerType ( new ( server ) ) ;
917917 }
918918 SetResult ( message , true ) ;
919919 return true ;
@@ -941,14 +941,14 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
941941 {
942942 targetSeconds = ( timeoutSeconds * 3 ) / 4 ;
943943 }
944- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (CONFIG) timeout: " + targetSeconds + "s" ) ;
944+ Log ? . LogInformationAutoConfiguredConfigTimeout ( new ( server ) , targetSeconds ) ;
945945 server . WriteEverySeconds = targetSeconds ;
946946 }
947947 }
948948 else if ( key . IsEqual ( CommonReplies . databases ) && val . TryGetInt64 ( out i64 ) )
949949 {
950950 int dbCount = checked ( ( int ) i64 ) ;
951- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (CONFIG) databases: " + dbCount ) ;
951+ Log ? . LogInformationAutoConfiguredConfigDatabases ( new ( server ) , dbCount ) ;
952952 server . Databases = dbCount ;
953953 if ( dbCount > 1 )
954954 {
@@ -960,12 +960,12 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
960960 if ( val . IsEqual ( CommonReplies . yes ) )
961961 {
962962 server . ReplicaReadOnly = true ;
963- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (CONFIG) read-only replica: true" ) ;
963+ Log ? . LogInformationAutoConfiguredConfigReadOnlyReplica ( new ( server ) , true ) ;
964964 }
965965 else if ( val . IsEqual ( CommonReplies . no ) )
966966 {
967967 server . ReplicaReadOnly = false ;
968- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (CONFIG) read-only replica: false" ) ;
968+ Log ? . LogInformationAutoConfiguredConfigReadOnlyReplica ( new ( server ) , false ) ;
969969 }
970970 }
971971 }
@@ -982,34 +982,34 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
982982 if ( key . IsEqual ( CommonReplies . version ) && Format . TryParseVersion ( val . GetString ( ) , out var version ) )
983983 {
984984 server . Version = version ;
985- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (HELLO) server- version: { version } " ) ;
985+ Log ? . LogInformationAutoConfiguredHelloServerVersion ( new ( server ) , version ) ;
986986 }
987987 else if ( key . IsEqual ( CommonReplies . proto ) && val . TryGetInt64 ( out var i64 ) )
988988 {
989989 connection . SetProtocol ( i64 >= 3 ? RedisProtocol . Resp3 : RedisProtocol . Resp2 ) ;
990- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (HELLO) protocol: { connection . Protocol } " ) ;
990+ Log ? . LogInformationAutoConfiguredHelloProtocol ( new ( server ) , connection . Protocol ?? RedisProtocol . Resp2 ) ;
991991 }
992992 else if ( key . IsEqual ( CommonReplies . id ) && val . TryGetInt64 ( out i64 ) )
993993 {
994994 connection . ConnectionId = i64 ;
995- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (HELLO) connection-id: { i64 } " ) ;
995+ Log ? . LogInformationAutoConfiguredHelloConnectionId ( new ( server ) , i64 ) ;
996996 }
997997 else if ( key . IsEqual ( CommonReplies . mode ) && TryParseServerType ( val . GetString ( ) , out var serverType ) )
998998 {
999999 server . ServerType = serverType ;
1000- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (HELLO) server-type: { serverType } " ) ;
1000+ Log ? . LogInformationAutoConfiguredHelloServerType ( new ( server ) , serverType ) ;
10011001 }
10021002 else if ( key . IsEqual ( CommonReplies . role ) && TryParseRole ( val . GetString ( ) , out bool isReplica ) )
10031003 {
10041004 server . IsReplica = isReplica ;
1005- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (HELLO) role: { ( isReplica ? "replica" : "primary" ) } ") ;
1005+ Log ? . LogInformationAutoConfiguredHelloRole ( new ( server ) , isReplica ? "replica" : "primary" ) ;
10061006 }
10071007 }
10081008 }
10091009 else if ( message ? . Command == RedisCommand . SENTINEL )
10101010 {
10111011 server . ServerType = ServerType . Sentinel ;
1012- Log ? . LogInformation ( $ " { Format . ToString ( server ) } : Auto-configured (SENTINEL) server-type: sentinel" ) ;
1012+ Log ? . LogInformationAutoConfiguredSentinelServerType ( new ( server ) ) ;
10131013 }
10141014 SetResult ( message , true ) ;
10151015 return true ;
0 commit comments