Skip to content

Commit 68fac44

Browse files
committed
added copyright, whitespace, renamed to listeners
1 parent 7f9ed5f commit 68fac44

File tree

2 files changed

+169
-5
lines changed

2 files changed

+169
-5
lines changed

.idea/workspace.xml

Lines changed: 149 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pymongo/event_listeners.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1+
# Copyright 2019-present MongoDB, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
import logging
216

317
from pymongo import monitoring
418

5-
class CommandLogger(monitoring.CommandListener):
19+
20+
class CommandListener(monitoring.CommandListener):
621

722
def started(self, event):
823
logging.info("Command {0.command_name} with request id "
@@ -22,7 +37,7 @@ def failed(self, event):
2237
"microseconds".format(event))
2338

2439

25-
class ServerLogger(monitoring.ServerListener):
40+
class ServerListener(monitoring.ServerListener):
2641

2742
def opened(self, event):
2843
logging.info("Server {0.server_address} added to topology "
@@ -43,7 +58,7 @@ def closed(self, event):
4358
"{0.topology_id}".format(event))
4459

4560

46-
class HeartbeatLogger(monitoring.ServerHeartbeatListener):
61+
class HeartbeatListener(monitoring.ServerHeartbeatListener):
4762

4863
def started(self, event):
4964
logging.info("Heartbeat sent to server "
@@ -60,7 +75,7 @@ def failed(self, event):
6075
"failed with error {0.reply}".format(event))
6176

6277

63-
class TopologyLogger(monitoring.TopologyListener):
78+
class TopologyListener(monitoring.TopologyListener):
6479

6580
def opened(self, event):
6681
logging.info("Topology with id {0.topology_id} "
@@ -89,7 +104,7 @@ def closed(self, event):
89104
"closed".format(event))
90105

91106

92-
class ConnectionPoolLogger(ConnectionPoolListener):
107+
class ConnectionPoolListener(ConnectionPoolListener):
93108

94109
def pool_created(self, event):
95110
logging.info("[pool {0.address}] pool created".format(event))

0 commit comments

Comments
 (0)