summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2021-02-07 15:33:24 +0330
committerAndreas Kling <kling@serenityos.org>2021-02-08 18:08:55 +0100
commit09a43969ba957b3484cc9387344fea145f46aa46 (patch)
tree0e2077e1d8af02b06e39cb4ca6cbfcba37052c73 /Userland/Libraries/LibCore
parent1f8a633cc762fc3ca8544ee75ce25a7a8860d4be (diff)
downloadserenity-09a43969ba957b3484cc9387344fea145f46aa46.zip
Everywhere: Replace dbgln<flag>(...) with dbgln_if(flag, ...)
Replacement made by `find Kernel Userland -name '*.h' -o -name '*.cpp' | sed -i -Ee 's/dbgln\b<(\w+)>\(/dbgln_if(\1, /g'`
Diffstat (limited to 'Userland/Libraries/LibCore')
-rw-r--r--Userland/Libraries/LibCore/Gzip.cpp4
-rw-r--r--Userland/Libraries/LibCore/NetworkJob.cpp2
-rw-r--r--Userland/Libraries/LibCore/Socket.cpp12
-rw-r--r--Userland/Libraries/LibCore/SyscallUtils.h2
4 files changed, 10 insertions, 10 deletions
diff --git a/Userland/Libraries/LibCore/Gzip.cpp b/Userland/Libraries/LibCore/Gzip.cpp
index 87002b2b47..25c88bb15c 100644
--- a/Userland/Libraries/LibCore/Gzip.cpp
+++ b/Userland/Libraries/LibCore/Gzip.cpp
@@ -102,7 +102,7 @@ static Optional<ByteBuffer> get_gzip_payload(const ByteBuffer& data)
}
auto new_size = data.size() - current;
- dbgln<GZIP_DEBUG>("get_gzip_payload: Returning slice from {} with size {}", current, new_size);
+ dbgln_if(GZIP_DEBUG, "get_gzip_payload: Returning slice from {} with size {}", current, new_size);
return data.slice(current, new_size);
}
@@ -110,7 +110,7 @@ Optional<ByteBuffer> Gzip::decompress(const ByteBuffer& data)
{
ASSERT(is_compressed(data));
- dbgln<GZIP_DEBUG>("Gzip::decompress: Decompressing gzip compressed data. size={}", data.size());
+ dbgln_if(GZIP_DEBUG, "Gzip::decompress: Decompressing gzip compressed data. size={}", data.size());
auto optional_payload = get_gzip_payload(data);
if (!optional_payload.has_value()) {
return Optional<ByteBuffer>();
diff --git a/Userland/Libraries/LibCore/NetworkJob.cpp b/Userland/Libraries/LibCore/NetworkJob.cpp
index c3a742ed4b..46d91a1a7a 100644
--- a/Userland/Libraries/LibCore/NetworkJob.cpp
+++ b/Userland/Libraries/LibCore/NetworkJob.cpp
@@ -55,7 +55,7 @@ void NetworkJob::did_finish(NonnullRefPtr<NetworkResponse>&& response)
NonnullRefPtr<NetworkJob> protector(*this);
m_response = move(response);
- dbgln<CNETWORKJOB_DEBUG>("{} job did_finish", *this);
+ dbgln_if(CNETWORKJOB_DEBUG, "{} job did_finish", *this);
ASSERT(on_finish);
on_finish(true);
shutdown();
diff --git a/Userland/Libraries/LibCore/Socket.cpp b/Userland/Libraries/LibCore/Socket.cpp
index dbe0476b81..06c30c31f5 100644
--- a/Userland/Libraries/LibCore/Socket.cpp
+++ b/Userland/Libraries/LibCore/Socket.cpp
@@ -79,7 +79,7 @@ bool Socket::connect(const String& hostname, int port)
}
IPv4Address host_address((const u8*)hostent->h_addr_list[0]);
- dbgln<CSOCKET_DEBUG>("Socket::connect: Resolved '{}' to {}", hostname, host_address);
+ dbgln_if(CSOCKET_DEBUG, "Socket::connect: Resolved '{}' to {}", hostname, host_address);
return connect(host_address, port);
}
@@ -98,7 +98,7 @@ bool Socket::connect(const SocketAddress& address, int port)
{
ASSERT(!is_connected());
ASSERT(address.type() == SocketAddress::Type::IPv4);
- dbgln<CSOCKET_DEBUG>("{} connecting to {}...", *this, address);
+ dbgln_if(CSOCKET_DEBUG, "{} connecting to {}...", *this, address);
ASSERT(port > 0 && port <= 65535);
@@ -119,7 +119,7 @@ bool Socket::connect(const SocketAddress& address)
{
ASSERT(!is_connected());
ASSERT(address.type() == SocketAddress::Type::Local);
- dbgln<CSOCKET_DEBUG>("{} connecting to {}...", *this, address);
+ dbgln_if(CSOCKET_DEBUG, "{} connecting to {}...", *this, address);
sockaddr_un saddr;
saddr.sun_family = AF_LOCAL;
@@ -138,7 +138,7 @@ bool Socket::connect(const SocketAddress& address)
bool Socket::common_connect(const struct sockaddr* addr, socklen_t addrlen)
{
auto connected = [this] {
- dbgln<CSOCKET_DEBUG>("{} connected!", *this);
+ dbgln_if(CSOCKET_DEBUG, "{} connected!", *this);
if (!m_connected) {
m_connected = true;
ensure_read_notifier();
@@ -153,7 +153,7 @@ bool Socket::common_connect(const struct sockaddr* addr, socklen_t addrlen)
int rc = ::connect(fd(), addr, addrlen);
if (rc < 0) {
if (errno == EINPROGRESS) {
- dbgln<CSOCKET_DEBUG>("{} connection in progress (EINPROGRESS)", *this);
+ dbgln_if(CSOCKET_DEBUG, "{} connection in progress (EINPROGRESS)", *this);
m_notifier = Notifier::construct(fd(), Notifier::Event::Write, this);
m_notifier->on_ready_to_write = move(connected);
return true;
@@ -163,7 +163,7 @@ bool Socket::common_connect(const struct sockaddr* addr, socklen_t addrlen)
errno = saved_errno;
return false;
}
- dbgln<CSOCKET_DEBUG>("{} connected ok!", *this);
+ dbgln_if(CSOCKET_DEBUG, "{} connected ok!", *this);
connected();
return true;
}
diff --git a/Userland/Libraries/LibCore/SyscallUtils.h b/Userland/Libraries/LibCore/SyscallUtils.h
index de14ffed23..1b577bd6c4 100644
--- a/Userland/Libraries/LibCore/SyscallUtils.h
+++ b/Userland/Libraries/LibCore/SyscallUtils.h
@@ -44,7 +44,7 @@ inline int safe_syscall(Syscall syscall, Args&&... args)
if (sysret == -1) {
if constexpr (SAFE_SYSCALL_DEBUG) {
int saved_errno = errno;
- dbgln<SAFE_SYSCALL_DEBUG>("Core::safe_syscall: {} ({}: {})", sysret, saved_errno, strerror(saved_errno));
+ dbgln_if(SAFE_SYSCALL_DEBUG, "Core::safe_syscall: {} ({}: {})", sysret, saved_errno, strerror(saved_errno));
}
if (errno == EINTR)