summaryrefslogtreecommitdiff
path: root/src/ctx.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:01:26 +0900
committerMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:01:26 +0900
commit4c9cc8a724dfee204fb7a42632c1cc802e6aa83f (patch)
treeff0f70f73dcd8385232350aca9c478c49312b265 /src/ctx.cpp
parentb8ba042912233045b6ca74f732bcc7265dfeb5b0 (diff)
Old logging infrastructure removed
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/ctx.cpp')
-rw-r--r--src/ctx.cpp38
1 files changed, 2 insertions, 36 deletions
diff --git a/src/ctx.cpp b/src/ctx.cpp
index 3ef2d4a..437feed 100644
--- a/src/ctx.cpp
+++ b/src/ctx.cpp
@@ -42,11 +42,9 @@ zmq::ctx_t::ctx_t (uint32_t io_threads_) :
tag (0xbadcafe0),
terminating (false)
{
- int rc;
-
// Initialise the array of mailboxes. Additional three slots are for
- // internal log socket and the zmq_term thread the reaper thread.
- slot_count = max_sockets + io_threads_ + 3;
+ // zmq_term thread and reaper thread.
+ slot_count = max_sockets + io_threads_ + 2;
slots = (mailbox_t**) malloc (sizeof (mailbox_t*) * slot_count);
alloc_assert (slots);
@@ -75,12 +73,6 @@ zmq::ctx_t::ctx_t (uint32_t io_threads_) :
slots [i] = NULL;
}
- // Create the logging infrastructure.
- log_socket = create_socket (ZMQ_PUB);
- zmq_assert (log_socket);
- rc = log_socket->bind ("sys://log");
- zmq_assert (rc == 0);
-
// Create the monitor object.
io_thread_t *io_thread = choose_io_thread (0);
zmq_assert (io_thread);
@@ -138,13 +130,6 @@ int zmq::ctx_t::terminate ()
zmq_assert (rc == 0);
zmq_assert (cmd.type == command_t::done);
- // Close the logging infrastructure.
- log_sync.lock ();
- rc = log_socket->close ();
- zmq_assert (rc == 0);
- log_socket = NULL;
- log_sync.unlock ();
-
// First send stop command to sockets so that any blocking calls
// can be interrupted. If there are no sockets we can ask reaper
// thread to stop.
@@ -322,25 +307,6 @@ zmq::endpoint_t zmq::ctx_t::find_endpoint (const char *addr_)
return *endpoint;
}
-void zmq::ctx_t::log (const char *format_, va_list args_)
-{
- // Create the log message.
- msg_t msg;
- int rc = msg.init_size (strlen (format_) + 1);
- errno_assert (rc == 0);
- memcpy (msg.data (), format_, msg.size ());
-
- // At this point we migrate the log socket to the current thread.
- // We rely on mutex for executing the memory barrier.
- log_sync.lock ();
- if (log_socket)
- log_socket->send (&msg, 0);
- log_sync.unlock ();
-
- rc = msg.close ();
- errno_assert (rc == 0);
-}
-
// The last used socket ID, or 0 if no socket was used so far.
zmq::atomic_counter_t zmq::ctx_t::max_socket_id;