Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
smalltalk: [ Pharo64-6.1, Pharo64-7.0, Pharo64-8.0, Pharo64-9.0, Pharo64-10, Pharo64-11, Pharo64-12, Pharo64-13, Pharo64-alpha ]
smalltalk: [ Pharo64-7.0, Pharo64-8.0, Pharo64-9.0, Pharo64-10, Pharo64-11, Pharo64-12, Pharo64-13, Pharo64-alpha ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Thus, it should be safe to depend on a fixed major version and moving minor vers
| Version | Compatible Pharo versions |
|------------- |------------------------------|
| 1.x.x | Pharo 61, 70, 80, 90, 10, 11, 12, 13, 14 |
| 2.x.x | Pharo 70, 80, 90, 10, 11, 12, 13, 14 |

## Contact

Expand Down
6 changes: 0 additions & 6 deletions src/TinyLogger-Tests/TinyAbstractLoggerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ TinyAbstractLoggerTest >> actualClass [
^ self subclassResponsibility
]

{ #category : 'helpers' }
TinyAbstractLoggerTest >> skipInPharo6 [
self flag: #pharo6. "There is a bug with stdout in Pharo 6 and a hack to manage it. But it breaks the tests so we skip the tests using Stdio streams. Remove that when compatibility with P6 will be dropped."
SystemVersion current major < 7 ifTrue: [ self skip ]
]

{ #category : 'tests' }
TinyAbstractLoggerTest >> testClearLog [
self subclassResponsibility
Expand Down
20 changes: 4 additions & 16 deletions src/TinyLogger-Tests/TinyLoggerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ TinyLoggerTest >> testAddFileLoggerNamed [
TinyLoggerTest >> testAddLogger [

logger removeAllLoggers.
self flag: #Pharo7. "When P7 compatibility will be dropped, use #assertEmpty: here and in other tests."
self assert: logger loggers isEmpty.

logger
Expand Down Expand Up @@ -159,7 +160,6 @@ TinyLoggerTest >> testEnsureTranscriptLogger [
{ #category : 'tests' }
TinyLoggerTest >> testExecuteRecordedAs [
| contents stream bool |
self skipInPharo6.
bool := false.
logger
removeAllLoggers;
Expand All @@ -178,7 +178,6 @@ TinyLoggerTest >> testExecuteRecordedAs [
{ #category : 'tests' }
TinyLoggerTest >> testExecuteRecordedAs2 [
| contents stream |
self skipInPharo6.
logger
timestampFormatBlock: [ :s | s nextPutAll: 'No time' ];
removeAllLoggers;
Expand All @@ -203,7 +202,6 @@ No time : End: This is a new test
{ #category : 'tests' }
TinyLoggerTest >> testExecuteRecordedAsBlock [
| log |
self skipInPharo6.
log := 'testFileForTinyLogger.log' asFileReference.
[
logger execute: [ ] recordedAs: [ 'this is a test' ].
Expand All @@ -216,7 +214,6 @@ TinyLoggerTest >> testExecuteRecordedAsBlock [
{ #category : 'tests' }
TinyLoggerTest >> testExecuteRecordedAsBlock2 [
| log |
self skipInPharo6.
log := 'testFileForTinyLogger.log' asFileReference.
[
logger addFileLoggerNamed: log basename.
Expand All @@ -233,7 +230,6 @@ TinyLoggerTest >> testExecuteRecordedAsBlock2 [
TinyLoggerTest >> testExecuteRecordedAsKeepRightIndentation [

| contents stream errorDetected |
self skipInPharo6.
errorDetected := false.
logger
timestampFormatBlock: [ :s | s nextPutAll: 'No time' ];
Expand Down Expand Up @@ -262,7 +258,6 @@ No time : End: This is a new test
{ #category : 'tests' }
TinyLoggerTest >> testExecuteRecordedAsReturnBlockContent [
| contents stream bool |
self skipInPharo6.
bool := false.
logger
removeAllLoggers;
Expand Down Expand Up @@ -302,7 +297,6 @@ TinyLoggerTest >> testHasLoggers [
TinyLoggerTest >> testIndentationString [

| contents stream bool |
self skipInPharo6.
bool := false.
logger
removeAllLoggers;
Expand Down Expand Up @@ -333,7 +327,6 @@ TinyLoggerTest >> testLoggers [
{ #category : 'tests' }
TinyLoggerTest >> testNestedExecuteRecordedAs [
| contents stream bool1 bool2 |
self skipInPharo6.
bool1 := false.
bool2 := false.
logger
Expand All @@ -359,7 +352,6 @@ TinyLoggerTest >> testNestedExecuteRecordedAs [
{ #category : 'tests' }
TinyLoggerTest >> testRecord [
| contents stream |
self skipInPharo6.
logger
removeAllLoggers;
addStdoutLogger;
Expand All @@ -378,7 +370,6 @@ TinyLoggerTest >> testRecord [
{ #category : 'tests' }
TinyLoggerTest >> testRecord2 [
| contents stream |
self skipInPharo6.
logger
removeAllLoggers;
addStdoutLogger;
Expand Down Expand Up @@ -554,13 +545,10 @@ TinyLoggerTest >> testTranscriptLoggers [
TinyLoggerTest >> testValueDuringRestoresOriginalLogger [
"Do not use assert/deny:identicalTo: for compatibility with Pharo 6"

self assert: TinyCurrentLogger value == logger.
self assert: TinyCurrentLogger value identicalTo: logger.

TinyCurrentLogger
value: TinyLogger new
during: [ self deny: TinyCurrentLogger value == logger ].

self assert: TinyCurrentLogger value == logger
TinyCurrentLogger value: TinyLogger new during: [ self deny: TinyCurrentLogger value identicalTo: logger ].
self assert: TinyCurrentLogger value identicalTo: logger
]

{ #category : 'tests' }
Expand Down
2 changes: 0 additions & 2 deletions src/TinyLogger-Tests/TinyStdoutLoggerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ TinyStdoutLoggerTest >> testClearLog [
TinyStdoutLoggerTest >> testIndentationString [

| stream |
self skipInPharo6.
stream := '' writeStream.
[
Stdio stub stdout willReturn: stream.
Expand All @@ -37,7 +36,6 @@ TinyStdoutLoggerTest >> testIndentationString [
{ #category : 'tests' }
TinyStdoutLoggerTest >> testRecord [
| stream |
self skipInPharo6.
stream := '' writeStream.
[ Stdio stub stdout willReturn: stream.
logger record: 'This is a test'.
Expand Down
12 changes: 1 addition & 11 deletions src/TinyLogger/TinyStdoutLogger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ Examples
Class {
#name : 'TinyStdoutLogger',
#superclass : 'TinyLeafLogger',
#instVars : [
'streamClassProvider'
],
#category : 'TinyLogger-Core',
#package : 'TinyLogger',
#tag : 'Core'
Expand All @@ -35,13 +32,6 @@ TinyStdoutLogger >> clearLog [

]

{ #category : 'initialization' }
TinyStdoutLogger >> initialize [
super initialize.
self flag: #pharo6. "This is needed because in Pharo 6.1 Stdio does not works well. When Pharo 7 will be the minimum supported, remove this hack."
streamClassProvider := SystemVersion current major < 7 ifTrue: [ FileStream ] ifFalse: [ Stdio ]
]

{ #category : 'opening' }
TinyStdoutLogger >> open [

Expand All @@ -51,7 +41,7 @@ TinyStdoutLogger >> open [
{ #category : 'logging' }
TinyStdoutLogger >> record: aString [
| stream |
stream := streamClassProvider stdout.
stream := Stdio stdout.
self record: aString on: stream.

"The flush is needed to send the record in the stdout."
Expand Down