Skip to content

Commit

Permalink
Fix typed logging
Browse files Browse the repository at this point in the history
Looks like I broke this when I added Sorbet types. I don't think this
affected any released gems, but my logs were filling up with:

```
    ____  _                        ___ _____          __
   / __ \(_)________ ___  ______ _/ (_) __(_)__  ____/ /
  / / / / / ___/ __ `/ / / / __ `/ / / /_/ / _ \/ __  /
 / /_/ / (__  ) /_/ / /_/ / /_/ / / / __/ /  __/ /_/ /
/_____/_/____/\__, /\__,_/\__,_/_/_/_/ /_/\___/\__,_/
                /_/                          v0.5.0
{ delay: 1.0..5.0, pool_size: 5, error_hooks_size: 1 }
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
T::Private::Types::Void::VOID
```
  • Loading branch information
zachahn committed Dec 8, 2024
1 parent 1967af3 commit d629ed1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/disqualified/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ module Disqualified::Logging

module_function

sig { params(parts: T.untyped).void }
sig { params(parts: T.untyped).returns(String) }
def format_log(*parts)
*extras, message = parts

if extras.empty?
message
message.to_s
else
"#{extras.map { |x| "[#{x}]" }.join(" ")} #{message}"
end
Expand Down

0 comments on commit d629ed1

Please sign in to comment.