From 80dcc9268c95d3eb4096ba29fa776ce1c0f296b5 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sat, 15 Jun 2019 01:06:33 +0200 Subject: [PATCH 01/14] Add quick start --- documentation/UserGuide.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/documentation/UserGuide.md b/documentation/UserGuide.md index 8347003..41d5283 100644 --- a/documentation/UserGuide.md +++ b/documentation/UserGuide.md @@ -7,6 +7,7 @@ Users can configure the way the logger works and the image will use this configu For specific cases, a specialized logger can be used. - [User documentation of TinyLogger](#user-documentation-of-tinylogger) + * [Quick start](#quick-start) * [Configure your logger](#configure-your-logger) + [Add sub-loggers to your `TinyLogger`](#add-sub-loggers-to-your--tinylogger-) + [Remove sub-loggers](#remove-sub-loggers) @@ -16,6 +17,40 @@ For specific cases, a specialized logger can be used. + [Record a single line log](#record-a-single-line-log) + [Recording the execution of a task](#recording-the-execution-of-a-task) * [Use another logger than the global logger](#use-another-logger-than-the-global-logger) + +## Quick start + +This section will explain in 30 seconds how to create a logger for an application and use it. Then we will explore more advance features. + +Here is an example fo snippet to create a logger using a file `Progress.log`: + +```Smalltalk +TinyLogger default + addFileLoggerNamed: 'Progress.log'. +``` + +This code need to be executed **one time** in the image. For an application, it will probably be added to a method *initialize* on the class side of a class to be executed one time at the loading of the project in the image. + +In case you need to execute the code multiple times you can use this snippet instead: + +```Smalltalk +TinyLogger default + ensureFileLoggerNamed: 'Progress.log'. +``` + +Then write a message to the log using `record`: + +```Smalltalk +'Uh oh. Something happened.' record +``` + +Or wrap the execution of an action by logs using `execute:recordedAs:`: + +```Smalltalk +self execute: [ "Some code doing something" ] recordedAs: 'Launching bananas.' +``` + +Now, if you want to know more about the project, let's proceed on a more detailed documentation. ## Configure your logger From 1b5f2a27089c1dbdf17fd77146084788af3137b7 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sat, 15 Jun 2019 01:11:56 +0200 Subject: [PATCH 02/14] Add user doc on ensure --- documentation/UserGuide.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/documentation/UserGuide.md b/documentation/UserGuide.md index 41d5283..3eacbb3 100644 --- a/documentation/UserGuide.md +++ b/documentation/UserGuide.md @@ -85,6 +85,19 @@ TinyLogger default addFileLoggerNamed: '../logs/MyOtherLog.log'. ``` +Additionaly to those methods, `TinyLogger` also propose ways to add loggers only if they have no equivalent already registered. + +In order to archieve this result, you can use the equivalent of the methods previously explained, replacing `add` by `ensure`: +```Smalltalk +TinyLogger default + ensureStdoutLogger; + ensureTranscriptLogger; + ensureFileLogger; + ensureFileLoggerNamed: '../logs/MyOtherLog.log'. +``` + +With those methods, Transcript and Stdout loggers will be limited to one, and file loggers will be limited to one by file name. + ### Remove sub-loggers If at some point you wants to remove one or multiple loggers, `TinyLogger` has some API elements to do that. From fd16629334ed6bba98776b4709d008ad5396b520 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sat, 15 Jun 2019 01:12:50 +0200 Subject: [PATCH 03/14] Fix link --- documentation/UserGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/UserGuide.md b/documentation/UserGuide.md index 3eacbb3..42ee1c1 100644 --- a/documentation/UserGuide.md +++ b/documentation/UserGuide.md @@ -9,7 +9,7 @@ For specific cases, a specialized logger can be used. - [User documentation of TinyLogger](#user-documentation-of-tinylogger) * [Quick start](#quick-start) * [Configure your logger](#configure-your-logger) - + [Add sub-loggers to your `TinyLogger`](#add-sub-loggers-to-your--tinylogger-) + + [Add sub-loggers to your `TinyLogger`](#add-sub-loggers-to-your-tinylogger-) + [Remove sub-loggers](#remove-sub-loggers) + [List the sub-loggers](#list-the-sub-loggers) + [Configure the timestamp format](#configure-the-timestamp-format) From 16b1b89ac22789e05c2dc3ce6013ac8c3684a3cd Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sat, 15 Jun 2019 01:16:57 +0200 Subject: [PATCH 04/14] Add user doc on clear logger --- documentation/UserGuide.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/documentation/UserGuide.md b/documentation/UserGuide.md index 42ee1c1..f671542 100644 --- a/documentation/UserGuide.md +++ b/documentation/UserGuide.md @@ -17,6 +17,7 @@ For specific cases, a specialized logger can be used. + [Record a single line log](#record-a-single-line-log) + [Recording the execution of a task](#recording-the-execution-of-a-task) * [Use another logger than the global logger](#use-another-logger-than-the-global-logger) + * [Clear your logger](#clear-your-logger) ## Quick start @@ -260,3 +261,15 @@ TinyCurrentLogger value: customLogger during: [ TinyCurrentLogger value record: 'Test2' ] ``` + +## Clear your logger + +Each logger can understand the method `#clearLogger`. This method will have as effet to clear the output of the loggers. The actual effect can be slightly different depending on the kind of logger: +- `TinyLogger` will send the message to all its sub loggers +- `Transcript` logger will clear the Transcript of Pharo +- `Stdout` logger will do nothing because it is not possible to clean a stdout +- `File` logger will erase the file used to log + +```Smalltalk +TinyLogger default clearLogger +``` From 685507d0d5d2ed77e10b3ede1c6a27f497ee9351 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sat, 15 Jun 2019 01:26:21 +0200 Subject: [PATCH 05/14] Update dev documentation --- documentation/DevelopmentGuide.md | 39 ++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/documentation/DevelopmentGuide.md b/documentation/DevelopmentGuide.md index 1d97a14..7f63400 100644 --- a/documentation/DevelopmentGuide.md +++ b/documentation/DevelopmentGuide.md @@ -45,23 +45,23 @@ Generates the accessors for the `url` variable and you can add a constructor: ```Smalltalk TinyHTTPLogger class>>url: aString - ^ self new - url: aString; - yourself + ^ self new + url: aString; + yourself ``` Since `TinyLogger` groups its loggers by kinds, you need to define a `kind` method on the class side. ```Smalltalk TinyHTTPLogger class>>kind - ^ 'HTTP' + ^ 'HTTP' ``` Next step is to define the `record:` method to actually write the log. The superclass manages the preamble and formating directly via the method `record:on:` that needs to be called in your `record:` method. ```Smalltalk TinyHTTPLogger>>record: aString - ZnEasy post: self url data: (String streamContents: [ :s | self record: aString on: s ]) + ZnEasy post: self url data: (String streamContents: [ :s | self record: aString on: s ]) ``` At this point, our new logger is usable. You can add a new instance to your `TinyLogger` this way: @@ -76,7 +76,7 @@ The first one is to create and add a new HTTP logger: ```Smalltalk TinyLogger>>addHTTPLogger: aString - self addLogger: (TinyHTTPLogger url: aString) + self addLogger: (TinyHTTPLogger url: aString) ``` The logger can now be used like this: @@ -89,20 +89,33 @@ Another method to add as extension is a method to get all the HTTP loggers: ```Smalltalk TinyLogger>>httpLoggers - ^ self loggersMap at: TinyHTTPLogger kind ifAbsentPut: [ OrderedCollection new ] + ^ self loggersMap at: TinyHTTPLogger kind ifAbsentPut: [ OrderedCollection new ] ``` -And the last method will be used to remove all HTTP loggers of the logger: +Now that we have `httpLoggers`, we can easily add an `ensureHTTPLogger:` method matching `addHTTPLogger:`: ```Smalltalk - TinyLogger>>removeHTTPLoggers - self httpLoggers removeAll +TinyLogger>>ensureHTTPLogger: aString + self httpLoggers + detect: [ :e | e url = aString ] + ifNone: [ self addHTTPLogger: aString ] ``` -At this point you have one new logger kind available! - - +And the last method to add as extension will be used to remove all HTTP loggers of the logger: +```Smalltalk + TinyLogger>>removeHTTPLoggers + self httpLoggers removeAll +``` +One last method to implement is `clearLogger` to clean the previous logs if the user want it: +```Smalltalk +TinyHTTPLogger>>record: aString + ZnClient new + beOneShot; + url: self url; + delete +``` +At this point you have one new logger kind available! From 40262c5c01be012bda275cf995d2fa76a6e5f6df Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sat, 15 Jun 2019 01:30:11 +0200 Subject: [PATCH 06/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8abd081..06e16c6 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Thus, it should be safe to depend on a fixed major version and moving minor vers | MDL version | Compatible Pharo versions | |------------- |--------------------------- | -| 1.x.x | Pharo 61, 70 | +| 1.x.x | Pharo 61, 70, 80 | ## Contact From 0f4d09dd2cb1848d81e1027f7168c358fedfe7b7 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sat, 15 Jun 2019 01:30:29 +0200 Subject: [PATCH 07/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06e16c6..ac82f07 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Thus, it should be safe to depend on a fixed major version and moving minor vers ## Smalltalk versions compatibility -| MDL version | Compatible Pharo versions | +| Version | Compatible Pharo versions | |------------- |--------------------------- | | 1.x.x | Pharo 61, 70, 80 | From 0badf53ac4aa2eb7547bab52e37e4ffe9a6e3b09 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sat, 15 Jun 2019 18:54:39 +0200 Subject: [PATCH 08/14] Move quick start to README 1/2 --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index ac82f07..70955de 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ A really small logger for Pharo applications. - [Installation](#installation) + - [Quick start](#quick-start) - [Documentation](#documentation) - [Version management](#version-management) - [Smalltalk versions compatibility](#smalltalk-versions-compatibility) @@ -31,6 +32,38 @@ spec Note you can replace the #master by another branch such as #development or a tag such as #v1.0.0, #v1.? or #v1.2.? . +## Quick start + +Here is a snippet to create a logger using a file `Progress.log`: + +```Smalltalk +TinyLogger default + addFileLoggerNamed: 'Progress.log'. +``` + +This code need to be executed **one time** in the image. For an application, it will probably be added to a method *initialize* on the class side of a class to be executed one time at the loading of the project in the image. + +In case you need to execute the code multiple times you can use this snippet instead: + +```Smalltalk +TinyLogger default + ensureFileLoggerNamed: 'Progress.log'. +``` + +Then write a message to the log using `record`: + +```Smalltalk +'Uh oh. Something happened.' record +``` + +Or wrap the execution of an action by logs using `execute:recordedAs:`: + +```Smalltalk +self execute: [ "Some code doing something" ] recordedAs: 'Launching bananas.' +``` + +Now, if you want to know more about the project, let's proceed on a more detailed documentation. + ## Documentation Documentation is split into separate links as follows: From f129a347e3464d69ea651a5eb0f927aa0cb2d0b3 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sat, 15 Jun 2019 18:55:34 +0200 Subject: [PATCH 09/14] Move quick start to README 2/2 --- documentation/UserGuide.md | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/documentation/UserGuide.md b/documentation/UserGuide.md index f671542..cfe06fd 100644 --- a/documentation/UserGuide.md +++ b/documentation/UserGuide.md @@ -7,7 +7,6 @@ Users can configure the way the logger works and the image will use this configu For specific cases, a specialized logger can be used. - [User documentation of TinyLogger](#user-documentation-of-tinylogger) - * [Quick start](#quick-start) * [Configure your logger](#configure-your-logger) + [Add sub-loggers to your `TinyLogger`](#add-sub-loggers-to-your-tinylogger-) + [Remove sub-loggers](#remove-sub-loggers) @@ -18,40 +17,7 @@ For specific cases, a specialized logger can be used. + [Recording the execution of a task](#recording-the-execution-of-a-task) * [Use another logger than the global logger](#use-another-logger-than-the-global-logger) * [Clear your logger](#clear-your-logger) - -## Quick start - -This section will explain in 30 seconds how to create a logger for an application and use it. Then we will explore more advance features. - -Here is an example fo snippet to create a logger using a file `Progress.log`: - -```Smalltalk -TinyLogger default - addFileLoggerNamed: 'Progress.log'. -``` - -This code need to be executed **one time** in the image. For an application, it will probably be added to a method *initialize* on the class side of a class to be executed one time at the loading of the project in the image. - -In case you need to execute the code multiple times you can use this snippet instead: - -```Smalltalk -TinyLogger default - ensureFileLoggerNamed: 'Progress.log'. -``` - -Then write a message to the log using `record`: - -```Smalltalk -'Uh oh. Something happened.' record -``` - -Or wrap the execution of an action by logs using `execute:recordedAs:`: - -```Smalltalk -self execute: [ "Some code doing something" ] recordedAs: 'Launching bananas.' -``` - -Now, if you want to know more about the project, let's proceed on a more detailed documentation. + ## Configure your logger From aaa3c9e411fb1ccbd0dba8259392e9cd097ca631 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sun, 16 Jun 2019 23:03:38 +0200 Subject: [PATCH 10/14] Follow Christopher recommandations. --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 70955de..bf270c1 100644 --- a/README.md +++ b/README.md @@ -34,20 +34,19 @@ Note you can replace the #master by another branch such as #development or a tag ## Quick start -Here is a snippet to create a logger using a file `Progress.log`: +To create a file logger using a file `Progress.log` and records all messages as soon as the project is loaded in a a Pharo image, in the initialize method (class side) of a project put the following: ```Smalltalk TinyLogger default addFileLoggerNamed: 'Progress.log'. ``` -This code need to be executed **one time** in the image. For an application, it will probably be added to a method *initialize* on the class side of a class to be executed one time at the loading of the project in the image. - -In case you need to execute the code multiple times you can use this snippet instead: +To create a file logger that is reset each time you run an application. Put the following in the method that is run: ```Smalltalk TinyLogger default - ensureFileLoggerNamed: 'Progress.log'. + ensureFileLoggerNamed: 'Progress.log'; "Add the file logger only if not already" + clearLog "This will delete the previous 'Progress.log' file". ``` Then write a message to the log using `record`: From fc8aee7a96b97e8207967291ba0a3122ca973f8d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sun, 16 Jun 2019 23:12:16 +0200 Subject: [PATCH 11/14] Follow Christopher feedback + doc --- src/TinyLogger-Tests/TinyAbstractLoggerTest.class.st | 2 +- src/TinyLogger-Tests/TinyFileLoggerTest.class.st | 4 ++-- src/TinyLogger-Tests/TinyLoggerTest.class.st | 4 ++-- src/TinyLogger-Tests/TinyStdoutLoggerTest.class.st | 4 ++-- src/TinyLogger/TinyAbstractLogger.class.st | 7 ++++--- src/TinyLogger/TinyFileLogger.class.st | 2 +- src/TinyLogger/TinyLogger.class.st | 10 ++++++---- src/TinyLogger/TinyStdoutLogger.class.st | 2 +- src/TinyLogger/TinyTranscriptLogger.class.st | 2 +- 9 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/TinyLogger-Tests/TinyAbstractLoggerTest.class.st b/src/TinyLogger-Tests/TinyAbstractLoggerTest.class.st index 40bdfcc..0576342 100644 --- a/src/TinyLogger-Tests/TinyAbstractLoggerTest.class.st +++ b/src/TinyLogger-Tests/TinyAbstractLoggerTest.class.st @@ -32,7 +32,7 @@ TinyAbstractLoggerTest >> skipInPharo6 [ ] { #category : #test } -TinyAbstractLoggerTest >> testClearLogger [ +TinyAbstractLoggerTest >> testClearLog [ self subclassResponsibility ] diff --git a/src/TinyLogger-Tests/TinyFileLoggerTest.class.st b/src/TinyLogger-Tests/TinyFileLoggerTest.class.st index 47701fe..ac31dcd 100644 --- a/src/TinyLogger-Tests/TinyFileLoggerTest.class.st +++ b/src/TinyLogger-Tests/TinyFileLoggerTest.class.st @@ -32,13 +32,13 @@ TinyFileLoggerTest >> testCanHaveDefaultFile [ ] { #category : #test } -TinyFileLoggerTest >> testClearLogger [ +TinyFileLoggerTest >> testClearLog [ log := (self fileNameNumber: 1) asFileReference. logger := self actualClass for: parentLogger named: log basename. logger record: 'this is a test'. self assert: log exists. - logger clearLogger. + logger clearLog. self deny: log exists ] diff --git a/src/TinyLogger-Tests/TinyLoggerTest.class.st b/src/TinyLogger-Tests/TinyLoggerTest.class.st index 2c46d88..1ab1c1c 100644 --- a/src/TinyLogger-Tests/TinyLoggerTest.class.st +++ b/src/TinyLogger-Tests/TinyLoggerTest.class.st @@ -77,7 +77,7 @@ TinyLoggerTest >> testAddTranscriptLogger [ ] { #category : #test } -TinyLoggerTest >> testClearLogger [ +TinyLoggerTest >> testClearLog [ logger addTranscriptLogger; addFileLoggerNamed: 'testFileForTinyLogger.log'; @@ -86,7 +86,7 @@ TinyLoggerTest >> testClearLogger [ logger record: 'Test'. self assert: (logger fileLoggers allSatisfy: [ :fileLogger | fileLogger fileReference exists ]). - logger clearLogger. + logger clearLog. self assert: (logger fileLoggers noneSatisfy: [ :fileLogger | fileLogger fileReference exists ]) ] diff --git a/src/TinyLogger-Tests/TinyStdoutLoggerTest.class.st b/src/TinyLogger-Tests/TinyStdoutLoggerTest.class.st index f1d302f..aa62320 100644 --- a/src/TinyLogger-Tests/TinyStdoutLoggerTest.class.st +++ b/src/TinyLogger-Tests/TinyStdoutLoggerTest.class.st @@ -13,8 +13,8 @@ TinyStdoutLoggerTest >> actualClass [ ] { #category : #test } -TinyStdoutLoggerTest >> testClearLogger [ - self shouldnt: [ logger clearLogger ] raise: Error +TinyStdoutLoggerTest >> testClearLog [ + self shouldnt: [ logger clearLog ] raise: Error ] { #category : #test } diff --git a/src/TinyLogger/TinyAbstractLogger.class.st b/src/TinyLogger/TinyAbstractLogger.class.st index 39c7263..52f318f 100644 --- a/src/TinyLogger/TinyAbstractLogger.class.st +++ b/src/TinyLogger/TinyAbstractLogger.class.st @@ -13,8 +13,9 @@ Users should configure a `TinyLogger` with the concrete loggers they want and u Public API and Key Messages -------------------- -- #record: Takes a string and record it. -- #<< Alias of #record: +- #record: Takes a string and record it. +- #<< Alias of #record:. +- #clearLog Clear the output of the logger. Will have different effect depending on the logger. " Class { @@ -34,7 +35,7 @@ TinyAbstractLogger >> << aString [ ] { #category : #logging } -TinyAbstractLogger >> clearLogger [ +TinyAbstractLogger >> clearLog [ "Whe called, this method should clear the previous logs" self subclassResponsibility diff --git a/src/TinyLogger/TinyFileLogger.class.st b/src/TinyLogger/TinyFileLogger.class.st index 655a82b..4a49aeb 100644 --- a/src/TinyLogger/TinyFileLogger.class.st +++ b/src/TinyLogger/TinyFileLogger.class.st @@ -56,7 +56,7 @@ TinyFileLogger class >> named: aString [ ] { #category : #logging } -TinyFileLogger >> clearLogger [ +TinyFileLogger >> clearLog [ self fileReference ensureDelete ] diff --git a/src/TinyLogger/TinyLogger.class.st b/src/TinyLogger/TinyLogger.class.st index fe2da8a..f8266d1 100644 --- a/src/TinyLogger/TinyLogger.class.st +++ b/src/TinyLogger/TinyLogger.class.st @@ -12,12 +12,14 @@ The user can configure the timestamp formating via the #timestampFormatBlock par Public API and Key Messages -------------------- -- #record:  Log the parameter we the sub loggers. -- #execute:recordedAs: Execute a block and log the task when it beging and ends. This will increase the identation of the logging. +- #record:  Log the parameter of the sub loggers +- #clearLog  Clear the output of the sub loggers +- #execute:recordedAs: Execute a block and log the task when it beging and ends. This will increase the identation of the logging - #addStdoutLogger Add a logger on Stdout - #addTrascriptLogger Add a logger on the Transcript - #addFileLogger Add a logger that will log in a file named `TinyLogger.log` - #addFileLoggerNamed: Add a logger on a file whose name is passed as parameter +- #ensure: Variant of all previous #addX message. This one will add the new logger only if there is not equivalent logger already present - #timestampFormatBlock: Give as parameter a block taking a stream as parameter and writing the timestamp you want Examples @@ -127,8 +129,8 @@ TinyLogger >> addTranscriptLogger [ ] { #category : #logging } -TinyLogger >> clearLogger [ - self loggers do: #clearLogger +TinyLogger >> clearLog [ + self loggers do: #clearLog ] { #category : #nesting } diff --git a/src/TinyLogger/TinyStdoutLogger.class.st b/src/TinyLogger/TinyStdoutLogger.class.st index 6dc5e20..ddf6ebb 100644 --- a/src/TinyLogger/TinyStdoutLogger.class.st +++ b/src/TinyLogger/TinyStdoutLogger.class.st @@ -26,7 +26,7 @@ TinyStdoutLogger class >> kind [ ] { #category : #logging } -TinyStdoutLogger >> clearLogger [ +TinyStdoutLogger >> clearLog [ "We do nothing here since we cannot clear stdout" diff --git a/src/TinyLogger/TinyTranscriptLogger.class.st b/src/TinyLogger/TinyTranscriptLogger.class.st index f881e4b..c7643b2 100644 --- a/src/TinyLogger/TinyTranscriptLogger.class.st +++ b/src/TinyLogger/TinyTranscriptLogger.class.st @@ -23,7 +23,7 @@ TinyTranscriptLogger class >> kind [ ] { #category : #logging } -TinyTranscriptLogger >> clearLogger [ +TinyTranscriptLogger >> clearLog [ Transcript clear ] From e818496209d13f527f86d5cf57d614b7d617ef56 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sun, 16 Jun 2019 23:15:31 +0200 Subject: [PATCH 12/14] More Christopher feedback. --- documentation/UserGuide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/UserGuide.md b/documentation/UserGuide.md index cfe06fd..31ef165 100644 --- a/documentation/UserGuide.md +++ b/documentation/UserGuide.md @@ -54,7 +54,7 @@ TinyLogger default Additionaly to those methods, `TinyLogger` also propose ways to add loggers only if they have no equivalent already registered. -In order to archieve this result, you can use the equivalent of the methods previously explained, replacing `add` by `ensure`: +To archieve this result, use the equivalent of the methods previously explained, replacing `add` by `ensure`: ```Smalltalk TinyLogger default ensureStdoutLogger; @@ -67,7 +67,7 @@ With those methods, Transcript and Stdout loggers will be limited to one, and fi ### Remove sub-loggers -If at some point you wants to remove one or multiple loggers, `TinyLogger` has some API elements to do that. +If at some point you want to remove one or multiple loggers, `TinyLogger` has an API for that. The first way to remove loggers is with the method `removeAllLoggers`, which removes all the loggers of each kind. @@ -230,7 +230,7 @@ TinyCurrentLogger value: customLogger during: [ ## Clear your logger -Each logger can understand the method `#clearLogger`. This method will have as effet to clear the output of the loggers. The actual effect can be slightly different depending on the kind of logger: +Each logger understands the method `#clearLog`. This method will have as effect to clear the output of the loggers. The actual effect is different depending on the kind of logger: - `TinyLogger` will send the message to all its sub loggers - `Transcript` logger will clear the Transcript of Pharo - `Stdout` logger will do nothing because it is not possible to clean a stdout From 439abb7592923bcef25905ef64d55b891b7bea81 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sun, 16 Jun 2019 23:16:48 +0200 Subject: [PATCH 13/14] Christopher's feedback --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf270c1..ab79e7f 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Then write a message to the log using `record`: 'Uh oh. Something happened.' record ``` -Or wrap the execution of an action by logs using `execute:recordedAs:`: +Or write a message to the log for the execution of an action using `execute:recordedAs:`: ```Smalltalk self execute: [ "Some code doing something" ] recordedAs: 'Launching bananas.' From 46515e3c2cf47173108048745be09182d8b1db1a Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sun, 16 Jun 2019 23:19:50 +0200 Subject: [PATCH 14/14] Update DevelopmentGuide.md --- documentation/DevelopmentGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/DevelopmentGuide.md b/documentation/DevelopmentGuide.md index 7f63400..8a24f09 100644 --- a/documentation/DevelopmentGuide.md +++ b/documentation/DevelopmentGuide.md @@ -57,7 +57,7 @@ Since `TinyLogger` groups its loggers by kinds, you need to define a `kind` met ^ 'HTTP' ``` -Next step is to define the `record:` method to actually write the log. The superclass manages the preamble and formating directly via the method `record:on:` that needs to be called in your `record:` method. +Next step is to define the `record:` method to actually write the log. The superclass manages the preamble and formatting directly via the method `record:on:` that needs to be called in your `record:` method. ```Smalltalk TinyHTTPLogger>>record: aString