-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement worker logger [feenkcom/gtoolkit#3778]
- add `TAsyncFutureLogger` - add `AsyncFutureDetailedTranscriptLogger` - add `AsyncFutureTranscriptLogger`
- Loading branch information
1 parent
37aa3b6
commit 23a47d3
Showing
4 changed files
with
130 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Class { | ||
#name : #AsyncFutureDetailedTranscriptLogger, | ||
#superclass : #Object, | ||
#traits : 'TAsyncFutureLogger', | ||
#classTraits : 'TAsyncFutureLogger classTrait', | ||
#instVars : [ | ||
'transcript' | ||
], | ||
#category : #'Futures-Executor - Logger' | ||
} | ||
|
||
{ #category : #accessing } | ||
AsyncFutureDetailedTranscriptLogger >> initialize [ | ||
super initialize. | ||
transcript := NonInteractiveTranscript stdout | ||
] | ||
|
||
{ #category : #private } | ||
AsyncFutureDetailedTranscriptLogger >> pendingItem: aPendingTask indent: anIndent [ | ||
| aDescription | | ||
anIndent | ||
timesRepeat: [ transcript | ||
space; | ||
space ]. | ||
aDescription := [ aPendingTask gtCompositionDescription asString ] | ||
on: Error | ||
do: [ :anError | anError return: aPendingTask className , ' ' , anError printString ]. | ||
aDescription lines | ||
do: [ :eachLine | | ||
transcript | ||
nextPutAll: eachLine trimBoth; | ||
space ]. | ||
transcript newLine | ||
] | ||
|
||
{ #category : #private } | ||
AsyncFutureDetailedTranscriptLogger >> pendingItems: someAsyncObjects indent: anIndent [ | ||
someAsyncObjects | ||
do: [ :eachAsyncObject | | ||
self pendingItem: eachAsyncObject indent: anIndent. | ||
self | ||
pendingItems: eachAsyncObject gtCompositionChildren | ||
indent: anIndent + 1 ] | ||
] | ||
|
||
{ #category : #logging } | ||
AsyncFutureDetailedTranscriptLogger >> pendingTask: aPendingTask [ | ||
self pendingItems: {aPendingTask} indent: 0 | ||
] | ||
|
||
{ #category : #accessing } | ||
AsyncFutureDetailedTranscriptLogger >> transcript [ | ||
^ transcript ifNil: [ transcript := NonInteractiveTranscript stdout ] | ||
] | ||
|
||
{ #category : #accessing } | ||
AsyncFutureDetailedTranscriptLogger >> transcript: anObject [ | ||
transcript := anObject | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Class { | ||
#name : #AsyncFutureTranscriptLogger, | ||
#superclass : #Object, | ||
#traits : 'TAsyncFutureLogger', | ||
#classTraits : 'TAsyncFutureLogger classTrait', | ||
#instVars : [ | ||
'transcript' | ||
], | ||
#category : #'Futures-Executor - Logger' | ||
} | ||
|
||
{ #category : #accessing } | ||
AsyncFutureTranscriptLogger >> initialize [ | ||
super initialize. | ||
transcript := NonInteractiveTranscript stdout | ||
] | ||
|
||
{ #category : #logging } | ||
AsyncFutureTranscriptLogger >> pendingTask: aPendingTask [ | ||
transcript | ||
nextPutAll: aPendingTask printString; | ||
cr | ||
] | ||
|
||
{ #category : #accessing } | ||
AsyncFutureTranscriptLogger >> transcript [ | ||
^ transcript ifNil: [ transcript := NonInteractiveTranscript stdout ] | ||
] | ||
|
||
{ #category : #accessing } | ||
AsyncFutureTranscriptLogger >> transcript: anObject [ | ||
transcript := anObject | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Trait { | ||
#name : #TAsyncFutureLogger, | ||
#category : #'Futures-Executor - Logger' | ||
} | ||
|
||
{ #category : #logging } | ||
TAsyncFutureLogger >> pendingTask: aPendingTask [ | ||
|
||
] |