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.1.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: v1.1.1
Choose a head ref
  • 5 commits
  • 9 files changed
  • 4 contributors

Commits on Dec 6, 2022

  1. Copy the full SHA
    6d46d71 View commit details
  2. Copy the full SHA
    0373ef8 View commit details

Commits on Jan 3, 2023

  1. Bump actions/checkout from 3.1.0 to 3.2.0 (#125)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 3.1.0 to 3.2.0.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@93ea575...755da8c)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 3, 2023
    Copy the full SHA
    b525d5c View commit details

Commits on Jan 9, 2023

  1. Move to new analyzer language settings (#126)

    Enable and fix a bunch of lints. Require Dart 2.18 or greater
    kevmoo authored Jan 9, 2023
    Copy the full SHA
    34ed68f View commit details

Commits on Jan 26, 2023

  1. add a publish script; prep to publish 1.1.1 (#128)

    * blast_repo fixes
    
    auto-publish
    
    * rev to 1.1.1
    devoncarew authored Jan 26, 2023
    Copy the full SHA
    399100a View commit details
Showing with 167 additions and 108 deletions.
  1. +34 −0 .github/workflows/no-response.yml
  2. +14 −0 .github/workflows/publish.yaml
  3. +3 −3 .github/workflows/test-package.yml
  4. +5 −0 CHANGELOG.md
  5. +5 −0 README.md
  6. +33 −41 analysis_options.yaml
  7. +7 −3 lib/src/logger.dart
  8. +3 −3 pubspec.yaml
  9. +63 −58 test/logging_test.dart
34 changes: 34 additions & 0 deletions .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# A workflow to close issues where the author hasn't responded to a request for
# more information; see https://github.com/godofredoc/no-response for docs.

name: No Response

# Both `issue_comment` and `scheduled` event types are required.
on:
issue_comment:
types: [created]
schedule:
# Schedule for five minutes after the hour, every hour
- cron: '5 * * * *'

# All permissions not specified are set to 'none'.
permissions:
issues: write

jobs:
noResponse:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'dart-lang' }}
steps:
- uses: godofredoc/no-response@0ce2dc0e63e1c7d2b87752ceed091f6d32c9df09
with:
responseRequiredLabel: "needs-info"
responseRequiredColor: 4774bc
daysUntilClose: 14
# Comment to post when closing an Issue for lack of response.
closeComment: >
Without additional information we're not able to resolve this
issue, so it will be closed at this time. You're still free to add
more info and respond to any questions above, though. We'll reopen
the case if you do. Thanks for your contribution!
token: ${{ github.token }}
14 changes: 14 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# A CI configuration to auto-publish pub packages.

name: Publish

on:
pull_request:
branches: [ master ]
push:
tags: [ 'v[0-9]+.[0-9]+.[0-9]+*' ]

jobs:
publish:
if: ${{ github.repository_owner == 'dart-lang' }}
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
6 changes: 3 additions & 3 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ jobs:
matrix:
sdk: [dev]
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
with:
sdk: ${{ matrix.sdk }}
@@ -47,9 +47,9 @@ jobs:
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [2.12.0, dev]
sdk: [2.18.0, dev]
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
with:
sdk: ${{ matrix.sdk }}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.1.1

* Add a check that throws if a logger name ends with '.'.
* Require Dart 2.18

## 1.1.0

* Add `Logger.attachedLoggers` which exposes all loggers created with the
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -68,3 +68,8 @@ Available logging methods are:
+ `log.fine(logged_content);`
+ `log.finer(logged_content);`
+ `log.finest(logged_content);`

## Publishing automation

For information about our publishing automation and release process, see
https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.
74 changes: 33 additions & 41 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,63 +1,55 @@
# https://dart.dev/guides/language/analysis-options
include: package:lints/recommended.yaml

analyzer:
strong-mode:
implicit-casts: false
language:
strict-casts: true
strict-raw-types: true

linter:
rules:
- annotate_overrides
- always_declare_return_types
- avoid_bool_literals_in_conditional_expressions
- avoid_catching_errors
- avoid_classes_with_only_static_members
- avoid_dynamic_calls
- avoid_function_literals_in_foreach_calls
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_relative_lib_imports
- avoid_private_typedef_functions
- avoid_redundant_argument_values
- avoid_returning_null
- avoid_returning_null_for_future
- avoid_returning_this
- avoid_unused_constructor_parameters
- await_only_futures
- camel_case_types
- avoid_void_async
- cancel_subscriptions
- comment_references
# See https://github.com/dart-lang/logging/issues/43
#- constant_identifier_names
- control_flow_in_finally
- directives_ordering
- empty_catches
- empty_constructor_bodies
- empty_statements
- hash_and_equals
- implementation_imports
- iterable_contains_unrelated_type
- library_names
- library_prefixes
- list_remove_unrelated_type
- join_return_with_assignment
- lines_longer_than_80_chars
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- non_constant_identifier_names
- no_runtimeType_toString
- omit_local_variable_types
- only_throw_errors
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_asserts_in_initializer_lists
- prefer_const_constructors
- prefer_final_fields
- prefer_generic_function_type_aliases
- prefer_initializing_formals
- prefer_interpolation_to_compose_strings
- prefer_const_declarations
- prefer_expression_function_bodies
- prefer_final_locals
- prefer_relative_imports
- prefer_single_quotes
- prefer_typing_uninitialized_variables
- slash_for_doc_comments
- sort_pub_dependencies
- test_types_in_equals
- throw_in_finally
- type_init_formals
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
- type_annotate_public_apis
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_lambdas
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_parenthesis
- unnecessary_raw_strings
- unnecessary_statements
- unnecessary_this
- use_if_null_to_convert_nulls_to_bools
- use_raw_strings
- use_string_buffers
- use_super_parameters
10 changes: 7 additions & 3 deletions lib/src/logger.dart
Original file line number Diff line number Diff line change
@@ -78,8 +78,12 @@ class Logger {
if (name.startsWith('.')) {
throw ArgumentError("name shouldn't start with a '.'");
}
if (name.endsWith('.')) {
throw ArgumentError("name shouldn't end with a '.'");
}

// Split hierarchical names (separated with '.').
var dot = name.lastIndexOf('.');
final dot = name.lastIndexOf('.');
Logger? parent;
String thisName;
if (dot == -1) {
@@ -157,7 +161,7 @@ class Logger {
}

/// Whether a message for [value]'s level is loggable in this logger.
bool isLoggable(Level value) => (value >= level);
bool isLoggable(Level value) => value >= level;

/// Adds a log record for a [message] at a particular [logLevel] if
/// `isLoggable(logLevel)` is true.
@@ -198,7 +202,7 @@ class Logger {
}
zone ??= Zone.current;

var record =
final record =
LogRecord(logLevel, msg, fullName, error, stackTrace, zone, object);

if (parent == null) {
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: logging
version: 1.1.0
version: 1.1.1

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

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.18.0 <3.0.0"

dev_dependencies:
lints: '>=1.0.0 <3.0.0'
lints: ^2.0.0
test: ^1.16.0
Loading