Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dart-archive/logging
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.0
Choose a base ref
...
head repository: dart-archive/logging
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.0.1
Choose a head ref
  • 1 commit
  • 4 files changed
  • 2 contributors

Commits on Mar 25, 2021

  1. List the log levels in the README (#97)

    Other cleanup:
    - Use `repository` over `homepage.
    - Use stable SDK and deps.
    - Drop dependency overrides.
    - Bump to v1.0 of Dart github action.
    - Test on the oldest supported SDK.
    
    Co-authored-by: John M. Wargo <johnwargo@users.noreply.github.com>
    natebosch and johnwargo authored Mar 25, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    83542ab View commit details
Showing with 33 additions and 15 deletions.
  1. +3 −3 .github/workflows/test-package.yml
  2. +4 −0 CHANGELOG.md
  3. +22 −3 README.md
  4. +4 −9 pubspec.yaml
6 changes: 3 additions & 3 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ jobs:
sdk: [dev]
steps:
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v0.3
- uses: dart-lang/setup-dart@v1.0
with:
sdk: ${{ matrix.sdk }}
- id: install
@@ -47,10 +47,10 @@ jobs:
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [dev]
sdk: [2.12.0, dev]
steps:
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v0.3
- uses: dart-lang/setup-dart@v1.0
with:
sdk: ${{ matrix.sdk }}
- id: install
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.1

* List log levels in README.

## 1.0.0

* Stable null safety release.
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -16,8 +16,18 @@ Logger.root.onRecord.listen((record) {
});
```

First, set the root `Level`. All messages at or above the level are sent to the
`onRecord` stream.
First, set the root `Level`. All messages at or above the current level are sent to the
`onRecord` stream. Available levels are:

+ `Level.OFF`
+ `Level.SHOUT`
+ `Level.SEVERE`
+ `Level.WARNING`
+ `Level.INFO`
+ `Level.CONFIG`
+ `Level.FINE`
+ `Level.FINER`
+ `Level.FINEST`

Then, listen on the `onRecord` stream for `LogRecord` events. The `LogRecord`
class has various properties for the message, error, logger name, and more.
@@ -47,4 +57,13 @@ evaluated only if the message is actually logged:
log.fine(() => [1, 2, 3, 4, 5].map((e) => e * 4).join("-"));
```

See the `Logger` class for the different logging methods.
Available logging methods are:

+ `log.shout(logged_content);`
+ `log.severe(logged_content);`
+ `log.warning(logged_content);`
+ `log.info(logged_content);`
+ `log.config(logged_content);`
+ `log.fine(logged_content);`
+ `log.finer(logged_content);`
+ `log.finest(logged_content);`
13 changes: 4 additions & 9 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
name: logging
version: 1.0.0
version: 1.0.1

description: >-
Provides APIs for debugging and error logging. This library introduces
abstractions similar to those used in other languages, such as the Closure
JS Logger and java.util.logging.Logger.
homepage: https://github.com/dart-lang/logging
repository: https://github.com/dart-lang/logging

environment:
sdk: '>=2.12.0-0 <3.0.0'
sdk: ">=2.12.0 <3.0.0"

dev_dependencies:
pedantic: ^1.10.0
test: ^1.16.0-nullsafety

dependency_overrides:
# These are required to get a version solve since they depend on this package
coverage: ^0.13.3
webkit_inspection_protocol: ^0.5.0
test: ^1.16.0