Skip to content

Commit

Permalink
🔧 rename object due to review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanecek committed Feb 29, 2024
1 parent 1bc0d45 commit c2dcf09
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Class {
#name : #ZnEventToLogRecordControllerTest,
#superclass : #TestCase,
#instVars : [
'logsController',
'loggingAsserter'
'loggingAsserter',
'zincEventToLogRecordAdapter'
],
#category : #'Hyperspace-Model-Tests-Zinc'
}
Expand All @@ -21,13 +21,13 @@ ZnEventToLogRecordControllerTest >> setUp [

super setUp.
loggingAsserter := LoggingAsserter on: self.
logsController := ZnEventToLogRecordController new
zincEventToLogRecordAdapter := ZnEventToLogRecordAdapter new
]

{ #category : #running }
ZnEventToLogRecordControllerTest >> tearDown [

logsController stop.
zincEventToLogRecordAdapter stopListeners.
loggingAsserter stopLoggers.

super tearDown
Expand All @@ -36,9 +36,9 @@ ZnEventToLogRecordControllerTest >> tearDown [
{ #category : #running }
ZnEventToLogRecordControllerTest >> testLogsOfIncomingGetRequest [

logsController
zincEventToLogRecordAdapter
logIncomingRequests: true;
startUp.
startUpListeners.

self
runMemoryLoggerDuring: [
Expand All @@ -65,9 +65,9 @@ ZnEventToLogRecordControllerTest >> testLogsOfIncomingGetRequest [
{ #category : #running }
ZnEventToLogRecordControllerTest >> testLogsOfIncomingPostRequest [
logsController
zincEventToLogRecordAdapter
logIncomingRequests: true;
startUp.
startUpListeners.
self
runMemoryLoggerDuring: [
Expand All @@ -93,9 +93,9 @@ ZnEventToLogRecordControllerTest >> testLogsOfIncomingPostRequest [
{ #category : #running }
ZnEventToLogRecordControllerTest >> testLogsOfOutgoingGetRequest [
logsController
zincEventToLogRecordAdapter
logOutgoingRequests: true;
startUp.
startUpListeners.
self
runMemoryLoggerDuring: [
Expand All @@ -120,9 +120,9 @@ ZnEventToLogRecordControllerTest >> testLogsOfOutgoingGetRequest [
{ #category : #running }
ZnEventToLogRecordControllerTest >> testLogsOfOutgoingPostRequest [
logsController
zincEventToLogRecordAdapter
logOutgoingRequests: true;
startUp.
startUpListeners.
self
runMemoryLoggerDuring: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Class {
#name : #ZnEventToLogRecordController,
#name : #ZnEventToLogRecordAdapter,
#superclass : #Object,
#instVars : [
'logOutgoingRequests',
Expand All @@ -10,7 +10,7 @@ Class {
}

{ #category : #'private - dumping' }
ZnEventToLogRecordController >> asStructuredRequest: aZnRequest [
ZnEventToLogRecordAdapter >> asStructuredRequest: aZnRequest [

| json |

Expand All @@ -22,7 +22,7 @@ ZnEventToLogRecordController >> asStructuredRequest: aZnRequest [
]

{ #category : #'private - dumping' }
ZnEventToLogRecordController >> asStructuredResponse: aZnResponse [
ZnEventToLogRecordAdapter >> asStructuredResponse: aZnResponse [

| json |

Expand All @@ -34,7 +34,7 @@ ZnEventToLogRecordController >> asStructuredResponse: aZnResponse [
]

{ #category : #'private - dumping' }
ZnEventToLogRecordController >> dumpConnectionEvent: aZnServerConnectionClosedEvent on: data [
ZnEventToLogRecordAdapter >> dumpConnectionEvent: aZnServerConnectionClosedEvent on: data [

data
at: #remoteAddress
Expand All @@ -44,7 +44,7 @@ ZnEventToLogRecordController >> dumpConnectionEvent: aZnServerConnectionClosedEv
]

{ #category : #'private - dumping' }
ZnEventToLogRecordController >> dumpRequestAndResponseOf: event on: json [
ZnEventToLogRecordAdapter >> dumpRequestAndResponseOf: event on: json [

| response |

Expand All @@ -57,7 +57,7 @@ ZnEventToLogRecordController >> dumpRequestAndResponseOf: event on: json [
]

{ #category : #'private - dumping' }
ZnEventToLogRecordController >> dumpRequestOf: event on: json [
ZnEventToLogRecordAdapter >> dumpRequestOf: event on: json [

json
at: #summary put: event printString;
Expand All @@ -69,7 +69,7 @@ ZnEventToLogRecordController >> dumpRequestOf: event on: json [
]

{ #category : #'system startup' }
ZnEventToLogRecordController >> initialize [
ZnEventToLogRecordAdapter >> initialize [

super initialize.

Expand All @@ -79,27 +79,19 @@ ZnEventToLogRecordController >> initialize [
]

{ #category : #'private - configuring' }
ZnEventToLogRecordController >> logIncomingRequests: aBoolean [
ZnEventToLogRecordAdapter >> logIncomingRequests: aBoolean [

logIncomingRequests := aBoolean
]

{ #category : #'private - configuring' }
ZnEventToLogRecordController >> logOutgoingRequests: aBoolean [
ZnEventToLogRecordAdapter >> logOutgoingRequests: aBoolean [

logOutgoingRequests := aBoolean
]

{ #category : #'system startup' }
ZnEventToLogRecordController >> startUp [

logOutgoingRequests then: [ self startUpOutgoingRequestListeners ].

logIncomingRequests then: [ self startUpIncomingRequestListeners ]
]

{ #category : #'system startup' }
ZnEventToLogRecordController >> startUpIncomingRequestListeners [
ZnEventToLogRecordAdapter >> startUpIncomingRequestListeners [

self subscribeToEventsOf: ZnServerConnectionClosedEvent andDo: [ :event |
LogRecord emitStructuredDebuggingInfo: 'Server closed connection'
Expand All @@ -120,7 +112,15 @@ ZnEventToLogRecordController >> startUpIncomingRequestListeners [
]

{ #category : #'system startup' }
ZnEventToLogRecordController >> startUpOutgoingRequestListeners [
ZnEventToLogRecordAdapter >> startUpListeners [

logOutgoingRequests then: [ self startUpOutgoingRequestListeners ].

logIncomingRequests then: [ self startUpIncomingRequestListeners ]
]

{ #category : #'system startup' }
ZnEventToLogRecordAdapter >> startUpOutgoingRequestListeners [

self subscribeToEventsOf: ZnRequestWrittenEvent andDo: [ :event |
LogRecord emitStructuredDebuggingInfo: 'Outgoing HTTP request sent'
Expand All @@ -133,13 +133,13 @@ ZnEventToLogRecordController >> startUpOutgoingRequestListeners [
]

{ #category : #'system startup' }
ZnEventToLogRecordController >> stop [
ZnEventToLogRecordAdapter >> stopListeners [

subscriptions do: [:subscription | ZnLogEvent announcer removeSubscription: subscription]
]

{ #category : #'system startup' }
ZnEventToLogRecordController >> subscribeToEventsOf: anEventType andDo: aBlock [
ZnEventToLogRecordAdapter >> subscribeToEventsOf: anEventType andDo: aBlock [

subscriptions add: (ZnLogEvent announcer when: anEventType do: aBlock)
]

0 comments on commit c2dcf09

Please sign in to comment.