-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1056 from contour-terminal/fix/relocation-error-o…
…n-fc39 Attempt to fix relocation error that happens on Fedora 39.
- Loading branch information
Showing
5 changed files
with
65 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* This file is part of the "libterminal" project | ||
* Copyright (c) 2019-2020 Christian Parpart <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#include <crispy/logstore.h> | ||
|
||
namespace logstore | ||
{ | ||
|
||
Sink::Sink(bool enabled, Writer writer): _enabled { enabled }, _writer { std::move(writer) } | ||
{ | ||
} | ||
|
||
Sink::Sink(bool enabled, std::ostream& output): | ||
Sink(enabled, [out = &output](std::string_view text) { | ||
*out << text; | ||
out->flush(); | ||
}) | ||
{ | ||
} | ||
|
||
Sink::Sink(bool enabled, std::shared_ptr<std::ostream> f): | ||
Sink(enabled, [f = std::move(f)](std::string_view text) { | ||
*f << text; | ||
f->flush(); | ||
}) | ||
{ | ||
} | ||
|
||
Sink& Sink::console() | ||
{ | ||
static auto instance = Sink(false, std::cout); | ||
return instance; | ||
} | ||
|
||
Sink& Sink::error_console() // NOLINT(readability-identifier-naming) | ||
{ | ||
static auto instance = Sink(true, std::cerr); | ||
return instance; | ||
} | ||
|
||
} // namespace logstore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters