Skip to content

Commit

Permalink
avoid crTrace(:)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-krivanek committed Nov 2, 2019
1 parent bd7f9ce commit 7f8b3d6
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/CodeExport/Class.extension.st
Expand Up @@ -33,7 +33,7 @@ Class >> fileOutOn: aFileStream [
Class >> fileOutOn: aFileStream initializing: aBool [
"File a description of the receiver on aFileStream."

self crTrace: self name.
SystemNotification signal: self name.
super fileOutOn: aFileStream.
self class nonTrivial
ifTrue: [
Expand All @@ -48,7 +48,7 @@ Class >> fileOutPool: aPool onFileStream: aFileStream [
| aPoolName |
(aPool isKindOf: SharedPool class) ifTrue:[^self notify: 'we do not fileout SharedPool type shared pools for now'].
aPoolName := self environment keyAtIdentityValue: aPool.
self crTrace: aPoolName.
SystemNotification signal: aPoolName.
aFileStream nextPutAll: 'Transcript show: ''' , aPoolName , '''; cr!'; cr.
aFileStream nextPutAll: 'Smalltalk at: #' , aPoolName , ' put: Dictionary new!'; cr.
aPool keys asSortedCollection do: [ :aKey | | aValue |
Expand Down
9 changes: 3 additions & 6 deletions src/Metacello-Base/ConfigurationOf.class.st
Expand Up @@ -179,8 +179,7 @@ ConfigurationOf class >> ensureMetacello: loadList [
on: Error
do: [ :ex |
error := ex.
self
crTrace:
SystemNotification signal:
(String
streamContents: [ :stream |
stream nextPutAll: 'failed ensureMetacello using '.
Expand Down Expand Up @@ -216,11 +215,9 @@ ConfigurationOf class >> retry: aBlock retryCount: retryCount [
on: Error
do: [ :ex |
count < retryCount
ifTrue: [ self crTrace: 'RETRYING AFTER:'.
ex description crTrace.
ifTrue: [ SystemNotification signal: 'RETRYING AFTER: ', String cr, ex description.
(Delay forSeconds: 5) wait ]
ifFalse: [ self crTrace: 'FAILED RETRYING:'.
ex description crTrace.
ifFalse: [ SystemNotification signal: 'FAILED RETRYING:', String cr, ex description.
ex pass ] ].
count := count + 1 ]
]
Expand Down
2 changes: 1 addition & 1 deletion src/Metacello-Base/Metacello.class.st
Expand Up @@ -601,7 +601,7 @@ Metacello >> onWarning: aBlock [
Metacello >> onWarningLog [
self
onWarning: [ :ex |
self crTrace: ex description.
SystemNotification signal: ex description.
ex resume ]
]

Expand Down
Expand Up @@ -412,7 +412,7 @@ MCGitBasedNetworkRepository >> flushCache [
[ localRepository flushCache ]
on: Error
do: [ :ex |
self crTrace: 'Error for: ' , self description printString , ' during flushCache: ', ex description printString ].
SystemNotification signal: 'Error for: ' , self description printString , ' during flushCache: ', ex description printString ].
self class flushDownloadCache.

directory := self calculateRepositoryDirectory.
Expand Down
12 changes: 6 additions & 6 deletions src/Metacello-MC/MetacelloCommonMCSpecLoader.class.st
Expand Up @@ -169,7 +169,7 @@ MetacelloCommonMCSpecLoader >> loadPackageDirective: aPackageLoadDirective gofer
ifTrue: [ loadBlock valueSupplyingMetacelloAnswers: answers ]
ifFalse: [ loadBlock value ].
resolvedReference workingCopy repositoryGroup addRepository: aPackageLoadDirective repository.
self crTrace:
SystemNotification signal:
'Loaded -> ' , resolvedReference name , ' --- '
, aPackageLoadDirective repository repositoryDescription , ' --- '
, resolvedReference repository description
Expand All @@ -195,7 +195,7 @@ MetacelloCommonMCSpecLoader >> loadPackageDirectives: pkgLoads gofer: aGofer [
goferLoad addResolved: resolvedReference.
answers addAll: packageLoadDirective spec answers.
packageLoadDirective resolvedReference: resolvedReference ] ].
self crTrace: 'Starting atomic load'.
SystemNotification signal: 'Starting atomic load'.
loadBlock := [
"pkgLoads do: [:packageLoadDirective | mcLoader preLoad: packageLoadDirective spec ]."
goferLoad execute.
Expand Down Expand Up @@ -225,7 +225,7 @@ MetacelloCommonMCSpecLoader >> loadPackageDirectives: pkgLoads gofer: aGofer [
answers notEmpty
ifTrue: [ loadBlock valueSupplyingMetacelloAnswers: answers ]
ifFalse: [ loadBlock value ].
self crTrace: 'Finished atomic load' ]
SystemNotification signal: 'Finished atomic load' ]
displaying: 'Atomic Load...'
]

Expand Down Expand Up @@ -365,7 +365,7 @@ MetacelloCommonMCSpecLoader >> retryingResolvePackageSpecReferences: packageSpec
whileTrue: [
retryCount > 0
ifTrue: [
self crTrace: '...RETRY->' , packageSpec file ].
SystemNotification signal: '...RETRY->' , packageSpec file ].
references := [ self resolvePackageSpecReferences: packageSpec gofer: gofer ]
on: Error , GoferRepositoryError
do: [ :ex |
Expand All @@ -376,15 +376,15 @@ MetacelloCommonMCSpecLoader >> retryingResolvePackageSpecReferences: packageSpec
(ex isKindOf: GoferRepositoryError)
ifTrue: [
"ignore repository errors at this point, in case an alternate repository is in the list "
self crTrace: 'gofer repository error: ' , ex description printString , '...ignoring'.
SystemNotification signal: 'gofer repository error: ' , ex description printString , '...ignoring'.
repositoryError := ex.
ex resume: #() ]
ifFalse: [ ex pass ] ].
ex return: #() ].
retryCount := retryCount + 1 ].
references isEmpty
ifTrue: [
self crTrace: '...FAILED->' , packageSpec file.
SystemNotification signal: '...FAILED->' , packageSpec file.
(MetacelloPackageSpecResolutionError new
packageSpec: packageSpec;
repositories: gofer repositories;
Expand Down
3 changes: 1 addition & 2 deletions src/Metacello-MC/MetacelloLoadingMCSpecLoader.class.st
Expand Up @@ -139,8 +139,7 @@ MetacelloLoadingMCSpecLoader >> linearLoadPackageSpec: packageSpec gofer: gofer
resolvedReference workingCopy repositoryGroup addRepository: repo ]
ifFalse: [ resolvedReference workingCopy repositoryGroup
addRepository: resolvedReference repository ].
self
crTrace:
SystemNotification signal:
'Loaded -> ' , resolvedReference name , ' --- '
, repo repositoryDescription , ' --- '
, resolvedReference repository description ]
Expand Down
Expand Up @@ -203,7 +203,7 @@ MCFileTreeAbstractReader >> packageProperties [
ifTrue: [ self error: 'noMethodMetaData and separateMethodMetaAndSource cannot both be true' ] ] ]
on: Error
do: [ :ex |
self crTrace:
SystemNotification signal:
'Error reading package properties (.filetree): ' , packageDirectory pathName , ' :: ' , ex description ] ] ] ].
^ packageProperties
]
Expand Down
2 changes: 1 addition & 1 deletion src/OpalCompiler-Core/OCReadOnlyVMWarning.class.st
Expand Up @@ -17,7 +17,7 @@ OCReadOnlyVMWarning >> defaultAction [
compilationContext: compilationContext;
messageText: self messageText;
signal ]
ifFalse: [ self crTrace: self messageText ])
ifFalse: [ SystemNotification signal: self messageText ])
]

{ #category : #initialization }
Expand Down
Expand Up @@ -24,6 +24,6 @@ OCStoreIntoReadOnlyVariableError >> description [
{ #category : #signaling }
OCStoreIntoReadOnlyVariableError >> signal [
compilationContext interactive
ifFalse: [ ^ self crTrace ].
ifFalse: [ ^ SystemNotification signal: self asString ].
^ super signal
]
2 changes: 1 addition & 1 deletion src/System-Support/SystemDictionary.class.st
Expand Up @@ -380,7 +380,7 @@ SystemDictionary >> renameClassNamed: oldName as: newName [
| oldClass |
(oldClass := self at: oldName asSymbol ifAbsent: [ nil ])
ifNil: [
self crTrace: 'Class-rename for ' , oldName , ' ignored because ' , oldName , ' does not exist.'.
SystemNotification signal: 'Class-rename for ' , oldName , ' ignored because ' , oldName , ' does not exist.'.
^ self ].
oldClass rename: newName
]
Expand Down
7 changes: 3 additions & 4 deletions src/System-Support/VirtualMachine.class.st
Expand Up @@ -445,10 +445,9 @@ VirtualMachine >> maxExternalSemaphores: aSize [
self maxExternalSemaphores ifNil: [ ^ 0 ].

[ self maxExternalSemaphoresSilently: aSize.
self
crTrace: 'WARNING: Had to increase size of semaphore signal handling table due to many external objects concurrently in use';
crTrace: 'You should increase this size at startup using #maxExternalSemaphoresSilently:';
crTrace: 'Current table size: ' , self maxExternalSemaphores printString ] forkAt: Processor userBackgroundPriority.
SystemNotification signal: ('WARNING: Had to increase size of semaphore signal handling table due to many external objects concurrently in use', String cr,
'You should increase this size at startup using #maxExternalSemaphoresSilently:', String cr,
'Current table size: ' , self maxExternalSemaphores printString) ] forkAt: Processor userBackgroundPriority.

self error: 'Not enough space for external objects, set a larger size at startup!'.
^ self maxExternalSemaphores
Expand Down

0 comments on commit 7f8b3d6

Please sign in to comment.