Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jun 22, 2019
1 parent 1db876a commit b4751f1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -75,6 +75,26 @@ end
MyObject.new.test_logger
```

### Subject Logging

The first argument to the log method is the subject.

```ruby
class Thing
def call
Console.logger.info(self) {"Something is going on"}
end
end
```

Using this approach, you can turn on and off specific subjects by using the class name:

```ruby
$ CONSOLE_DEBUG=Thing ./script.rb
```

This will conditionally enable all log statements which have a subject of class `Thing`.

### Console Formatting

Console classes are used to wrap data which can generate structured log messages:

0 comments on commit b4751f1

Please sign in to comment.