Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Nov 8, 2019
2 parents f417999 + ffedaad commit ff12ac6
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ SqueakDebug.log
# Metacello-github cache
/github-cache
github-*.zip

**/.DS_STORE
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<!-- git log --pretty="* %s ([%h](https://github.com/jecisc/TinyLogger/commit/%H))" v1.0.1...HEAD --grep="Merge "
('Content' copyWithRegex: 'Merge pull request #[0-9]+ from [^/]+/[0-9]*' matchesReplacedWith: ' ') copyReplaceAll: '-' with: ' '
<!--
git log --pretty="* %s ([%h](https://github.com/jecisc/TinyLogger/commit/%H))" v1.1.3...HEAD --grep="Merge pull"
('Content' copyWithRegex: 'Merge pull request #[0-9]+ from [^/]+/[0-9]*' matchesReplacedWith: '') copyReplaceAll: '-' with: ' '
-->

# [v1.1.3](https://github.com/jecisc/TinyLogger/compare/v1.1.2...v1.1.3) (2019-11-08)

## Infrastructure

* Improve test coverage using MuTalk (mutation testing) ([716cd41](https://github.com/jecisc/TinyLogger/commit/716cd41655614326b4e20a426bdb58ce5f0f2031))
* Fix a title in the documentation ([1d6af61](https://github.com/jecisc/TinyLogger/commit/1d6af61b6114533ab20ef3ffaad252f95925d3a8))

# [v1.1.2](https://github.com/jecisc/TinyLogger/compare/v1.1.1...v1.1.2) (2019-09-25)

## Infrastructure
Expand All @@ -10,11 +18,11 @@

# [v1.1.1](https://github.com/jecisc/TinyLogger/compare/v1.1.0...v1.1.1) (2019-09-18)

# Bug fixes
## Bug fixes

* Do not depend on whole Mocketry ([a50d354](https://github.com/jecisc/TinyLogger/commit/a50d3543bf00e76d780d7d3f2fb205280364b637))

# Infrastructure
## Infrastructure

* Deprecated method in Pharo 8 ([7f2ab1c](https://github.com/jecisc/TinyLogger/commit/7f2ab1c7a6fc43d23801faed40383e2b6d4279c3))

Expand Down
4 changes: 2 additions & 2 deletions documentation/DevelopmentGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A first part will cover the design of the project and a second part will be a tu
- [Developer documentation](#developer-documentation)
* [Design](#design)
* [TinyCurrentLogger dynamic variable](#tinycurrentlogger-dynamic-variable)
* [Add a new leaf transcript](#add-a-new-leaf-transcript)
* [Add a new leaf logger](#add-a-new-leaf-logger)

## Design

Expand All @@ -28,7 +28,7 @@ To record logs, the user will use extension methods implemented on `Object` as

The `TinyCurrentLogger` has a default value that is the default instance of `TinyLogger`. This value can be changed using the `value:during:` message as explained in the user documentation.

## Add a new leaf transcript
## Add a new leaf logger

In this section we will add a new leaf logger recording logs in a remote server via a HTTP request on a REST API.

Expand Down
26 changes: 26 additions & 0 deletions scripts/mutationTesting.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Metacello new
githubUser: 'jecisc' project: 'TinyLogger' commitish: 'v1.x.x' path: 'src';
baseline: 'TinyLogger';
load.

Metacello new
baseline: 'MuTalk';
repository: 'github://pavel-krivanek/mutalk/src';
load.

analysis := MutationTestingAnalysis
testCasesFrom: 'TinyLogger-Tests' asPackage definedClasses
mutating: 'TinyLogger' asPackage definedClasses
using: MutantOperator contents
with: AllTestsMethodsRunningMutantEvaluationStrategy new.
analysis run.
alive := analysis generalResult aliveMutants.

browser := GLMTabulator new.
browser
row: #results;
row: #diff.
browser transmit to: #results.
browser transmit to: #diff; from: #results; andShow: [ :a |
a diff display: [ :mutant | {((RBParser parseMethod: (mutant mutant originalSource)) formattedCode) . ((RBParser parseMethod: (mutant mutant modifiedSource)) formattedCode)}] ].
browser openOn: alive.
31 changes: 31 additions & 0 deletions src/TinyLogger-Tests/TinyLoggerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ TinyLoggerTest >> testClearLog [
self assert: (logger fileLoggers noneSatisfy: [ :fileLogger | fileLogger fileReference exists ])
]

{ #category : #test }
TinyLoggerTest >> testCurrentLogger [
self assert: TinyCurrentLogger value isNotNil.
self assert: TinyCurrentLogger value class equals: TinyLogger
]

{ #category : #test }
TinyLoggerTest >> testEnsureFileLogger [
logger removeAllLoggers.
Expand Down Expand Up @@ -160,6 +166,31 @@ TinyLoggerTest >> testExecuteRecordedAs [
stream close ]
]

{ #category : #test }
TinyLoggerTest >> testExecuteRecordedAs2 [
| contents stream |
self skipInPharo6.
logger
timestampFormatBlock: [ :s | s nextPutAll: 'No time' ];
removeAllLoggers;
addStdoutLogger.
stream := '' writeStream.
[ Stdio stub stdout willReturn: stream.
TinyCurrentLogger value: logger during: [ Object new execute: [ 'test' record ] recordedAs: 'This is a new test' ].
contents := Stdio stdout contents asString.

"Ensure we have the right indentation."
self
assert: contents withUnixLineEndings
equals:
'No time : Begin: This is a new test
No time : test
No time : End: This is a new test
' withUnixLineEndings ]
ensure: [ Stdio recoverFromGHMutation.
stream close ]
]

{ #category : #test }
TinyLoggerTest >> testFileLoggers [
logger
Expand Down
10 changes: 0 additions & 10 deletions src/TinyLogger/ManifestTinyLogger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,3 @@ Class {
#superclass : #PackageManifest,
#category : #'TinyLogger-Manifest'
}

{ #category : #'code-critics' }
ManifestTinyLogger class >> ruleRBCodeCruftLeftInMethodsRuleV1FalsePositive [
^ #(#(#(#RGClassDefinition #(#TinyTranscriptLogger)) #'2018-11-25T02:59:41.364573+01:00') )
]

{ #category : #'code-critics' }
ManifestTinyLogger class >> ruleRBCollectionMessagesToExternalObjectRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#TinyLogger #addLogger: #false)) #'2018-11-25T20:54:01.067573+01:00') #(#(#RGMethodDefinition #(#TinyLogger #removeLogger: #false)) #'2018-11-25T20:54:59.231573+01:00') )
]
2 changes: 2 additions & 0 deletions src/TinyLogger/TinyAbstractLogger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Class {

{ #category : #testing }
TinyAbstractLogger class >> isAbstract [
<ignoreForCoverage>
^ self = TinyAbstractLogger
]

Expand All @@ -48,5 +49,6 @@ TinyAbstractLogger >> record: aString [

{ #category : #accessing }
TinyAbstractLogger >> timestampFormatBlock [
<ignoreForCoverage>
^ self subclassResponsibility
]
3 changes: 2 additions & 1 deletion src/TinyLogger/TinyFileLogger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ TinyFileLogger class >> for: aLogger named: aString [

{ #category : #accessing }
TinyFileLogger class >> kind [
<ignoreForCoverage>
^ 'file'
]

Expand Down Expand Up @@ -84,7 +85,7 @@ TinyFileLogger >> fileReference [
TinyFileLogger >> fileStreamDo: aBlock [
"For now we re-open the file all the time to avoid problems when we change its image of computer/OS or if the user delete the file. Maybe later we can find a better solution but in any case we should test such weird behaviors."

^ self fileReference
self fileReference
ensureCreateFile;
writeStreamDo: [ :s |
s setToEnd.
Expand Down
3 changes: 2 additions & 1 deletion src/TinyLogger/TinyLeafLogger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ TinyLeafLogger class >> for: aTinyLogger [

{ #category : #testing }
TinyLeafLogger class >> isAbstract [
<ignoreForCoverage>
^ self = TinyLeafLogger
]

{ #category : #accessing }
TinyLeafLogger class >> kind [
<ignoreForCoverage>
^ self subclassResponsibility
]

Expand All @@ -67,7 +69,6 @@ TinyLeafLogger >> parentLogger [

{ #category : #accessing }
TinyLeafLogger >> parentLogger: aLogger [
parentLogger == aLogger ifTrue: [ ^ self ].
parentLogger := aLogger
]

Expand Down
2 changes: 1 addition & 1 deletion src/TinyLogger/TinyLogger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ TinyLogger class >> default: anObject [

{ #category : #initialization }
TinyLogger class >> reset [
^ self default: nil
self default: nil
]

{ #category : #'public API' }
Expand Down
1 change: 1 addition & 0 deletions src/TinyLogger/TinyStdoutLogger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Class {

{ #category : #accessing }
TinyStdoutLogger class >> kind [
<ignoreForCoverage>
^ 'stdout'
]

Expand Down
1 change: 1 addition & 0 deletions src/TinyLogger/TinyTranscriptLogger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Class {

{ #category : #accessing }
TinyTranscriptLogger class >> kind [
<ignoreForCoverage>
^ 'transcript'
]

Expand Down

0 comments on commit ff12ac6

Please sign in to comment.