55 "strconv"
66 "time"
77
8+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/kv"
89 "github.com/ydb-platform/ydb-go-sdk/v3/trace"
910)
1011
@@ -29,8 +30,8 @@ func internalCoordination(
2930
3031 return func (info trace.CoordinationNewDoneInfo ) {
3132 l .Log (WithLevel (ctx , INFO ), "done" ,
32- latencyField (start ),
33- versionField (),
33+ kv . Latency (start ),
34+ kv . Version (),
3435 )
3536 }
3637 },
@@ -40,19 +41,19 @@ func internalCoordination(
4041 }
4142 ctx := with (* info .Context , TRACE , "ydb" , "coordination" , "node" , "create" )
4243 l .Log (ctx , "start" ,
43- String ("path" , info .Path ),
44+ kv . String ("path" , info .Path ),
4445 )
4546 start := time .Now ()
4647
4748 return func (info trace.CoordinationCreateNodeDoneInfo ) {
4849 if info .Error == nil {
4950 l .Log (WithLevel (ctx , INFO ), "done" ,
50- latencyField (start ),
51+ kv . Latency (start ),
5152 )
5253 } else {
5354 l .Log (WithLevel (ctx , ERROR ), "fail" ,
54- latencyField (start ),
55- versionField (),
55+ kv . Latency (start ),
56+ kv . Version (),
5657 )
5758 }
5859 }
@@ -63,19 +64,19 @@ func internalCoordination(
6364 }
6465 ctx := with (* info .Context , TRACE , "ydb" , "coordination" , "node" , "alter" )
6566 l .Log (ctx , "start" ,
66- String ("path" , info .Path ),
67+ kv . String ("path" , info .Path ),
6768 )
6869 start := time .Now ()
6970
7071 return func (info trace.CoordinationAlterNodeDoneInfo ) {
7172 if info .Error == nil {
7273 l .Log (WithLevel (ctx , INFO ), "done" ,
73- latencyField (start ),
74+ kv . Latency (start ),
7475 )
7576 } else {
7677 l .Log (WithLevel (ctx , ERROR ), "fail" ,
77- latencyField (start ),
78- versionField (),
78+ kv . Latency (start ),
79+ kv . Version (),
7980 )
8081 }
8182 }
@@ -86,19 +87,19 @@ func internalCoordination(
8687 }
8788 ctx := with (* info .Context , TRACE , "ydb" , "coordination" , "node" , "drop" )
8889 l .Log (ctx , "start" ,
89- String ("path" , info .Path ),
90+ kv . String ("path" , info .Path ),
9091 )
9192 start := time .Now ()
9293
9394 return func (info trace.CoordinationDropNodeDoneInfo ) {
9495 if info .Error == nil {
9596 l .Log (WithLevel (ctx , INFO ), "done" ,
96- latencyField (start ),
97+ kv . Latency (start ),
9798 )
9899 } else {
99100 l .Log (WithLevel (ctx , ERROR ), "fail" ,
100- latencyField (start ),
101- versionField (),
101+ kv . Latency (start ),
102+ kv . Version (),
102103 )
103104 }
104105 }
@@ -109,19 +110,19 @@ func internalCoordination(
109110 }
110111 ctx := with (* info .Context , TRACE , "ydb" , "coordination" , "node" , "describe" )
111112 l .Log (ctx , "start" ,
112- String ("path" , info .Path ),
113+ kv . String ("path" , info .Path ),
113114 )
114115 start := time .Now ()
115116
116117 return func (info trace.CoordinationDescribeNodeDoneInfo ) {
117118 if info .Error == nil {
118119 l .Log (WithLevel (ctx , INFO ), "done" ,
119- latencyField (start ),
120+ kv . Latency (start ),
120121 )
121122 } else {
122123 l .Log (WithLevel (ctx , ERROR ), "fail" ,
123- latencyField (start ),
124- versionField (),
124+ kv . Latency (start ),
125+ kv . Version (),
125126 )
126127 }
127128 }
@@ -137,12 +138,12 @@ func internalCoordination(
137138 return func (info trace.CoordinationSessionDoneInfo ) {
138139 if info .Error == nil {
139140 l .Log (WithLevel (ctx , INFO ), "done" ,
140- latencyField (start ),
141+ kv . Latency (start ),
141142 )
142143 } else {
143144 l .Log (WithLevel (ctx , ERROR ), "fail" ,
144- latencyField (start ),
145- versionField (),
145+ kv . Latency (start ),
146+ kv . Version (),
146147 )
147148 }
148149 }
@@ -158,12 +159,12 @@ func internalCoordination(
158159 return func (info trace.CoordinationCloseDoneInfo ) {
159160 if info .Error == nil {
160161 l .Log (WithLevel (ctx , INFO ), "done" ,
161- latencyField (start ),
162+ kv . Latency (start ),
162163 )
163164 } else {
164165 l .Log (WithLevel (ctx , ERROR ), "fail" ,
165- latencyField (start ),
166- versionField (),
166+ kv . Latency (start ),
167+ kv . Version (),
167168 )
168169 }
169170 }
@@ -182,9 +183,9 @@ func internalCoordination(
182183
183184 return func (info trace.CoordinationStreamNewDoneInfo ) {
184185 l .Log (ctx , "done" ,
185- latencyField (start ),
186- Error (info .Error ),
187- versionField (),
186+ kv . Latency (start ),
187+ kv . Error (info .Error ),
188+ kv . Version (),
188189 )
189190 }
190191 },
@@ -194,8 +195,8 @@ func internalCoordination(
194195 }
195196 ctx := with (context .Background (), TRACE , "ydb" , "coordination" , "session" , "started" )
196197 l .Log (ctx , "" ,
197- String ("sessionID" , strconv .FormatUint (info .SessionID , 10 )),
198- String ("expectedSessionID" , strconv .FormatUint (info .SessionID , 10 )),
198+ kv . String ("sessionID" , strconv .FormatUint (info .SessionID , 10 )),
199+ kv . String ("expectedSessionID" , strconv .FormatUint (info .SessionID , 10 )),
199200 )
200201 },
201202 OnSessionStartTimeout : func (info trace.CoordinationSessionStartTimeoutInfo ) {
@@ -204,7 +205,7 @@ func internalCoordination(
204205 }
205206 ctx := with (context .Background (), TRACE , "ydb" , "coordination" , "session" , "start" , "timeout" )
206207 l .Log (ctx , "" ,
207- Stringer ("timeout" , info .Timeout ),
208+ kv . Stringer ("timeout" , info .Timeout ),
208209 )
209210 },
210211 OnSessionKeepAliveTimeout : func (info trace.CoordinationSessionKeepAliveTimeoutInfo ) {
@@ -213,8 +214,8 @@ func internalCoordination(
213214 }
214215 ctx := with (context .Background (), TRACE , "ydb" , "coordination" , "session" , "keepAlive" , "timeout" )
215216 l .Log (ctx , "" ,
216- Stringer ("timeout" , info .Timeout ),
217- Stringer ("lastGoodResponseTime" , info .LastGoodResponseTime ),
217+ kv . Stringer ("timeout" , info .Timeout ),
218+ kv . Stringer ("lastGoodResponseTime" , info .LastGoodResponseTime ),
218219 )
219220 },
220221 OnSessionStopped : func (info trace.CoordinationSessionStoppedInfo ) {
@@ -223,8 +224,8 @@ func internalCoordination(
223224 }
224225 ctx := with (context .Background (), TRACE , "ydb" , "coordination" , "session" , "stopped" )
225226 l .Log (ctx , "" ,
226- String ("sessionID" , strconv .FormatUint (info .SessionID , 10 )),
227- String ("expectedSessionID" , strconv .FormatUint (info .SessionID , 10 )),
227+ kv . String ("sessionID" , strconv .FormatUint (info .SessionID , 10 )),
228+ kv . String ("expectedSessionID" , strconv .FormatUint (info .SessionID , 10 )),
228229 )
229230 },
230231 OnSessionStopTimeout : func (info trace.CoordinationSessionStopTimeoutInfo ) {
@@ -233,7 +234,7 @@ func internalCoordination(
233234 }
234235 ctx := with (context .Background (), TRACE , "ydb" , "coordination" , "session" , "stop" , "timeout" )
235236 l .Log (ctx , "" ,
236- Stringer ("timeout" , info .Timeout ),
237+ kv . Stringer ("timeout" , info .Timeout ),
237238 )
238239 },
239240 OnSessionClientTimeout : func (info trace.CoordinationSessionClientTimeoutInfo ) {
@@ -242,8 +243,8 @@ func internalCoordination(
242243 }
243244 ctx := with (context .Background (), TRACE , "ydb" , "coordination" , "session" , "client" , "timeout" )
244245 l .Log (ctx , "" ,
245- Stringer ("timeout" , info .Timeout ),
246- Stringer ("lastGoodResponseTime" , info .LastGoodResponseTime ),
246+ kv . Stringer ("timeout" , info .Timeout ),
247+ kv . Stringer ("lastGoodResponseTime" , info .LastGoodResponseTime ),
247248 )
248249 },
249250 OnSessionServerExpire : func (info trace.CoordinationSessionServerExpireInfo ) {
@@ -252,7 +253,7 @@ func internalCoordination(
252253 }
253254 ctx := with (context .Background (), TRACE , "ydb" , "coordination" , "session" , "server" , "expire" )
254255 l .Log (ctx , "" ,
255- Stringer ("failure" , info .Failure ),
256+ kv . Stringer ("failure" , info .Failure ),
256257 )
257258 },
258259 OnSessionServerError : func (info trace.CoordinationSessionServerErrorInfo ) {
@@ -261,7 +262,7 @@ func internalCoordination(
261262 }
262263 ctx := with (context .Background (), TRACE , "ydb" , "coordination" , "session" , "server" , "error" )
263264 l .Log (ctx , "" ,
264- Stringer ("failure" , info .Failure ),
265+ kv . Stringer ("failure" , info .Failure ),
265266 )
266267 },
267268 OnSessionReceive : func (
@@ -278,10 +279,10 @@ func internalCoordination(
278279
279280 return func (info trace.CoordinationSessionReceiveDoneInfo ) {
280281 l .Log (ctx , "done" ,
281- latencyField (start ),
282- Error (info .Error ),
283- Stringer ("response" , info .Response ),
284- versionField (),
282+ kv . Latency (start ),
283+ kv . Error (info .Error ),
284+ kv . Stringer ("response" , info .Response ),
285+ kv . Version (),
285286 )
286287 }
287288 },
@@ -291,7 +292,7 @@ func internalCoordination(
291292 }
292293 ctx := with (context .Background (), TRACE , "ydb" , "coordination" , "session" , "receive" , "unexpected" )
293294 l .Log (ctx , "" ,
294- Stringer ("response" , info .Response ),
295+ kv . Stringer ("response" , info .Response ),
295296 )
296297 },
297298 OnSessionStop : func (info trace.CoordinationSessionStopInfo ) {
@@ -300,7 +301,7 @@ func internalCoordination(
300301 }
301302 ctx := with (context .Background (), TRACE , "ydb" , "coordination" , "session" , "stop" )
302303 l .Log (ctx , "" ,
303- String ("sessionID" , strconv .FormatUint (info .SessionID , 10 )),
304+ kv . String ("sessionID" , strconv .FormatUint (info .SessionID , 10 )),
304305 )
305306 },
306307 OnSessionStart : func (
@@ -317,9 +318,9 @@ func internalCoordination(
317318
318319 return func (info trace.CoordinationSessionStartDoneInfo ) {
319320 l .Log (ctx , "done" ,
320- latencyField (start ),
321- Error (info .Error ),
322- versionField (),
321+ kv . Latency (start ),
322+ kv . Error (info .Error ),
323+ kv . Version (),
323324 )
324325 }
325326 },
@@ -333,15 +334,15 @@ func internalCoordination(
333334 }
334335 ctx := with (context .Background (), TRACE , "ydb" , "coordination" , "session" , "send" )
335336 l .Log (ctx , "start" ,
336- Stringer ("request" , info .Request ),
337+ kv . Stringer ("request" , info .Request ),
337338 )
338339 start := time .Now ()
339340
340341 return func (info trace.CoordinationSessionSendDoneInfo ) {
341342 l .Log (ctx , "done" ,
342- latencyField (start ),
343- Error (info .Error ),
344- versionField (),
343+ kv . Latency (start ),
344+ kv . Error (info .Error ),
345+ kv . Version (),
345346 )
346347 }
347348 },
0 commit comments