Skip to content

Commit 749ab1a

Browse files
author
Alexander Popov
committed
fix: change logging
1 parent 9440c8b commit 749ab1a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

mamonsu/plugins/pgsql/memory_leak_diagnostic.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import re
55
from distutils.version import LooseVersion
66
import mamonsu.lib.platform as platform
7-
import logging
87

98

109
class MemoryLeakDiagnostic(Plugin):
@@ -24,7 +23,7 @@ def __init__(self, config):
2423
super(Plugin, self).__init__(config)
2524
if not platform.LINUX:
2625
self.disable()
27-
logging.error('Plugin {name} work only on Linux. '.format(name=self.__class__.__name__))
26+
self.log.error('Plugin {name} work only on Linux. '.format(name=self.__class__.__name__))
2827

2928
if self.is_enabled():
3029
self.page_size = os.sysconf('SC_PAGE_SIZE')
@@ -42,9 +41,9 @@ def __init__(self, config):
4241
ratio = 1024 * 1024 * 1024 * 1024
4342
else:
4443
self.disable()
45-
logging.error('Error in config, section [{section}], parameter private_anon_mem_threshold. '
46-
'Possible values MB, GB, TB. For example 1GB.'
47-
.format(section=self.__class__.__name__.lower()))
44+
self.log.error('Error in config, section [{section}], parameter private_anon_mem_threshold. '
45+
'Possible values MB, GB, TB. For example 1GB.'
46+
.format(section=self.__class__.__name__.lower()))
4847

4948
self.diff = ratio * int(private_anon_mem_threshold)
5049

@@ -53,7 +52,7 @@ def __init__(self, config):
5352
try:
5453
release_file = open(os_release_file, 'r').readlines()
5554
except Exception as e:
56-
logging.info(f'Cannot read file {os_release_file} : {e}')
55+
self.log.info(f'Cannot read file {os_release_file} : {e}')
5756
release_file = None
5857

5958
if release_file:

0 commit comments

Comments
 (0)