Skip to content

Commit a2e3eb3

Browse files
committed
Migration guide
1 parent a3803ae commit a2e3eb3

File tree

2 files changed

+80
-1
lines changed

2 files changed

+80
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ A really small logger for Pharo applications.
88
- [Installation](#installation)
99
- [Quick start](#quick-start)
1010
- [Documentation](#documentation)
11+
- [Migration](#migration)
1112
- [Version management](#version-management)
1213
- [Smalltalk versions compatibility](#smalltalk-versions-compatibility)
1314
- [Contact](#contact)
@@ -70,6 +71,10 @@ Documentation is split into separate links as follows:
7071
* [User documentation](documentation/UserGuide.md)
7172
* [Developer documentation](documentation/DevelopmentGuide.md)
7273

74+
### Migration
75+
76+
- [Migrate from v1 to v2](documentation/v1toV2.md)
77+
7378
## Version management
7479

7580
This project use semantic versioning to define the releases. This means that each stable release of the project will be assigned a version number of the form `vX.Y.Z`.
@@ -91,4 +96,4 @@ Thus, it should be safe to depend on a fixed major version and moving minor vers
9196

9297
## Contact
9398

94-
If you have any questions or problems do not hesitate to open an issue or contact cyril (a) ferlicot.me
99+
If you have any questions or problems do not hesitate to open an issue or contact cyril (a) ferlicot.fr

documentation/v1toV2.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Migration guide v1 to v2
2+
3+
Between the v1 and v2 some things changed.
4+
5+
## Drop P6 compatibility
6+
7+
V2 does not work anymore with Pharo 6 and 6.1. If your project is on Pharo 6, keep using the version 1 of TinyLogger.
8+
9+
## Cannot add a logger created from #for:
10+
11+
In the past it was possible to do:
12+
13+
```Smalltalk
14+
TinyLogger default addLogger: (TinyTranscriptLogger for: TinyLogger default)
15+
```
16+
17+
Now this does not work anymore because #`for:` is now adding itself to the parameter. If you still do this, yu will end up with the logger duplicated.
18+
19+
You can now do:
20+
21+
```Smalltalk
22+
TinyLogger default addLogger: TinyTranscriptLogger new
23+
```
24+
25+
or:
26+
27+
```Smalltalk
28+
TinyLogger default addTrascriptLogger "or ensureTranscriptLogger"
29+
```
30+
31+
## Removal of the leading space before colon
32+
33+
In v1 the timestamp was followed by a space before the colon.
34+
35+
Like this:
36+
37+
```
38+
2018-11-29T23:19:55.511775+01:00 : This is a string to log
39+
```
40+
41+
In the v2 this was removed. If you want this space, you can add it the the #`timestampFormatBlock:`.
42+
43+
```Smalltalk
44+
TinyLogger default timestampFormatBlock: [ :aStream :timestamp | aStream << timestamp asString << ' ' ]
45+
```
46+
47+
48+
## Option execution block indentation
49+
50+
In the past, using `#execute:recordedAs:` was adding some extra indentation like this:
51+
52+
```Smalltalk
53+
self execute: [ 'Log' record ] recordedAs: 'Task'
54+
```
55+
56+
```
57+
2018-11-29T23:21:04.897775+01:00: Begin: Task
58+
2018-11-29T23:21:04.900775+01:00: Log
59+
2018-11-29T23:21:04.909775+01:00: End: Task
60+
```
61+
62+
Now it prints like this:
63+
64+
```
65+
2018-11-29T23:21:04.897775+01:00: Begin: Task
66+
2018-11-29T23:21:04.900775+01:00: Log
67+
2018-11-29T23:21:04.909775+01:00: End: Task
68+
```
69+
70+
In order to get the previous behavior you can use `#indentExecutionBlock:` like this:
71+
72+
```Smalltalk
73+
TinyLogger default indentExecutionBlock: true
74+
```

0 commit comments

Comments
 (0)