Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct formatting for fenced code blocks #7

Merged
merged 1 commit into from
Mar 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,24 @@ Then you can log with functions for each of the log levels (with their associate
* off

For example:
```Swift-3

```swift
log.error("This is an error!")
```
Setting the level of a log will only print out those logs at that level or above.
```Swift-3

```swift
log.level = .verbose
```
You can also initialize a log with a name. You may want to have different logs for App Lifecycle, API, UI, Data, etc. This would allow you to have different logs & set different log levels depending upon what you are trying to monitor or track down. The log name will be printed out as part of any log message for that log.
```Swift-3

```swift
let lifeCycleLog = Slog(name:"LifeCycle", level: .verbose, useEmoji: true)
```

You could use this log in the AppDelegate to monitor app lifecycles. For example putting this code in `didFinishLaunchingWithOptions`:
```Swift-3

```swift
lifeCycleLog.verbose("App finished launching with options \(launchOptions)")
```

Expand All @@ -53,18 +57,20 @@ Checks are designed to check if a condition is fulfilled, if it is not then an e
This is currently under development, so feel free to suggest new checks & reports as issues (or PRs).

### Checks
```Swift-3
// index is within the bounds of an array
check(index:, isInBoundsOf:)

```swift
// index is within the bounds of an array
check(index:, isInBoundsOf:)
```

### Reports
```Swift-3
// index is out of bounds of an array
report(index:, outOfBoundsOf: )

// unxpected nil for a variable
report(unexpectedNil:)
```swift
// index is out of bounds of an array
report(index:, outOfBoundsOf: )

// unxpected nil for a variable
report(unexpectedNil:)
```


Expand All @@ -82,9 +88,11 @@ pod "Slog"
```

If you don't want to use the check and report features, then you can use the LogOnly subspec:

```ruby
pod "Slog/LogOnly"
```

## Author

johnstricker, john.stricker@raizlabs.com
Expand Down