Skip to content

Commit 77ff26a

Browse files
authored
fix(logging): add missing process_type ostream operator<< (#972)
1 parent 8fd0024 commit 77ff26a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/ada/url_pattern_init.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <string_view>
1212
#include <string>
1313
#include <optional>
14+
#include <iostream>
1415

1516
#if ADA_TESTING
1617
#include <iostream>
@@ -40,6 +41,17 @@ struct url_pattern_init {
4041
pattern,
4142
};
4243

44+
friend std::ostream& operator<<(std::ostream& os, process_type type) {
45+
switch (type) {
46+
case process_type::url:
47+
return os << "url";
48+
case process_type::pattern:
49+
return os << "pattern";
50+
default:
51+
return os << "unknown";
52+
}
53+
}
54+
4355
// All strings must be valid UTF-8.
4456
// @see https://urlpattern.spec.whatwg.org/#process-a-urlpatterninit
4557
static tl::expected<url_pattern_init, errors> process(

0 commit comments

Comments
 (0)