You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2014-08-07-elixir-v0-15-0-released.markdown
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ If you are interested in the specific details for this release, [please check ou
16
16
17
17
## Logger
18
18
19
-
Elixir now ships with a new application called logger. This application provides [the Logger module](/docs/master/logger/Logger.html), which is the main API developers will use for logging:
19
+
Elixir now ships with a new application called logger. This application provides [the Logger module](/docs/stable/logger/Logger.html), which is the main API developers will use for logging:
20
20
21
21
```elixir
22
22
requireLogger
@@ -70,7 +70,7 @@ Function: #Function<20.90072148/0 in :erl_eval.expr/5>
70
70
As soon as we started working on Logger, we realized we could go further than simply translating Erlang messages and provide a fully featured logger library. At this moment, Logger also supports:
71
71
72
72
* 4 log levels: debug, info, warn and error
73
-
* Custom formatting: you can specify a format string that tells exactly how messages should be logged. The default string is: "$time $metadata[$level] $message\n" but [many attributes are supported](/docs/master/logger/Logger.Formatter.html)
73
+
* Custom formatting: you can specify a format string that tells exactly how messages should be logged. The default string is: "$time $metadata[$level] $message\n" but [many attributes are supported](/docs/stable/logger/Logger.Formatter.html)
74
74
* Custom translators: so you can translate log messages coming from any Erlang application into Elixir syntax
75
75
* Metadata: metadata allows developers to store information in the current process that will be available to all logged messages. For example, a web application can generate a `request_id`, store it as metadata, and all messages logged during that request will be properly identified with `request_id=...` in the log
76
76
@@ -136,7 +136,7 @@ In other words, aliases can be three different structures:
136
136
2. An anonymous function (that is invoked passing the task arguments)
137
137
3. A list containing strings or anonymous functions
138
138
139
-
You can find more information about aliases by reading the [Mix documentation](/docs/master/mix/) (there is a section about Aliases around the middle).
139
+
You can find more information about aliases by reading the [Mix documentation](/docs/stable/mix/) (there is a section about Aliases around the middle).
140
140
141
141
We also would like to thank [Anthony Grimes](https://github.com/raynes) for the support and [Phil Halgelberg](https://github.com/technomancy) for [the work on Lein](https://github.com/technomancy/leiningen) which Mix borrows a lot from.
Copy file name to clipboardExpand all lines: getting-started/mix-otp/genevent.markdown
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ There are a couple things that are important to highlight at this point:
62
62
2.`sync_notify/2` runs event handlers synchronously to the request
63
63
3.`notify/2` runs event handlers asynchronously
64
64
65
-
Therefore, `sync_notify/2` and `notify/2` are similar to `call/2` and `cast/2` in GenServer and using `sync_notify/2` is generally recommended. It works as a backpressure mechanism in the calling process, to reduce the likelihood of messages being sent more quickly than they can be dispatched to handlers.
65
+
Therefore, `sync_notify/2` and `notify/2` are analogous to `call/2` and `cast/2` in GenServer and using `sync_notify/2` is generally recommended. It works as a backpressure mechanism in the calling process, to reduce the likelihood of messages being sent more quickly than they can be dispatched to handlers.
66
66
67
67
Be sure to check other functionality provided by GenEvent in its [module documentation](/docs/stable/elixir/GenEvent.html). For now we have enough knowledge to add an event manager to our application.
68
68
@@ -100,7 +100,7 @@ test "sends events on create and crash", %{registry: registry} do
100
100
end
101
101
```
102
102
103
-
In order to test the functionality we want to add, we first define a `Forwarder`event handler similar to the one we typed in IEx previously. On `setup`, we start the event manager, pass it as an argument to the registry and add our `Forwarder` handler to the manager so events can be sent to the test process.
103
+
In order to test the functionality we want to add, we first define a `Forwarder`(the same one we typed in IEx previously). On `setup`, we start the event manager, pass it as an argument to the registry and add our `Forwarder` handler to the manager so events can be sent to the test process.
104
104
105
105
In the test, we create and stop a bucket process and use `assert_receive` to assert we will receive both `:create` and `:exit` messages. `assert_receive` has a default timeout of 500ms which should be more than enough for our tests. Also note that `assert_receive` expects a pattern, rather than a value, that's why we have used `^bucket` to match on the bucket pid.
0 commit comments