mirror of
https://github.com/hyprwm/hyprutils.git
synced 2025-12-20 07:00:10 +01:00
Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ac060bfcf | ||
| 1c527b30fe |
2 changed files with 5 additions and 1 deletions
|
|
@ -26,10 +26,13 @@ namespace Hyprutils {
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
class CSignalT : public CSignalBase {
|
class CSignalT : public CSignalBase {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using RefArg = std::conditional_t<std::is_reference_v<T> || std::is_arithmetic_v<T>, T, const T&>;
|
using RefArg = std::conditional_t<std::is_trivially_copyable_v<T>, T, const T&>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void emit(RefArg<Args>... args) {
|
void emit(RefArg<Args>... args) {
|
||||||
|
if (m_vListeners.empty() && m_vStaticListeners.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
if constexpr (sizeof...(Args) == 0)
|
if constexpr (sizeof...(Args) == 0)
|
||||||
emitInternal(nullptr);
|
emitInternal(nullptr);
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,7 @@ void CLoggerImpl::log(eLogLevel level, const std::string_view& msg, const std::s
|
||||||
if (m_stdoutEnabled) {
|
if (m_stdoutEnabled) {
|
||||||
try {
|
try {
|
||||||
std::println("{}{}", m_colorEnabled ? logPrefixColor : logPrefix, logMsg);
|
std::println("{}{}", m_colorEnabled ? logPrefixColor : logPrefix, logMsg);
|
||||||
|
std::fflush(stdout);
|
||||||
} catch (std::exception& e) {
|
} catch (std::exception& e) {
|
||||||
; // this could be e.g. stdout closed
|
; // this could be e.g. stdout closed
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue