Esempio n. 1
0
    def set_logging(self, log_file, log_level):
        """
        Set logging parameters. Can be invoked either before or after
        invoking mount().

        When invoked before mount(), the preferred log file and log level
        choices are recorded and then later enforced internally as part of
        mount()

        When invoked at any point after mount(), the change in log file
        and log level is instantaneous.

        :param log_file: Path of log file.
                         If set to "/dev/null", nothing will be logged.
                         If set to None, a new logfile will be created in
                         default log directory (/var/log/glusterfs)
        :param log_level: Integer specifying the degree of verbosity.
                          Higher the value, more verbose the logging.
        """
        if self.fs:
            ret = api.glfs_set_logging(self.fs, self.log_file, self.log_level)
            if ret < 0:
                err = ctypes.get_errno()
                raise LibgfapiException(
                    "glfs_set_logging(%s, %s) failed: %s" %
                    (self.log_file, self.log_level, os.strerror(err)))
        self.log_file = log_file
        self.log_level = log_level
Esempio n. 2
0
    def set_logging(self, log_file, log_level):
        """
        Set logging parameters. Can be invoked either before or after
        invoking mount().

        When invoked before mount(), the preferred log file and log level
        choices are recorded and then later enforced internally as part of
        mount()

        When invoked at any point after mount(), the change in log file
        and log level is instantaneous.

        :param log_file: Path of log file.
                         If set to "/dev/null", nothing will be logged.
                         If set to None, a new logfile will be created in
                         default log directory (/var/log/glusterfs)
        :param log_level: Integer specifying the degree of verbosity.
                          Higher the value, more verbose the logging.
        """
        if self.fs:
            ret = api.glfs_set_logging(self.fs, self.log_file, self.log_level)
            if ret < 0:
                raise LibgfapiException("glfs_set_logging(%s, %s) failed." %
                                        (self.log_file, self.log_level))
        self.log_file = log_file
        self.log_level = log_level
Esempio n. 3
0
 def set_logging(self, path, level):
     api.glfs_set_logging(self.fs, path, level)
Esempio n. 4
0
 def set_logging(self, path, level):
     api.glfs_set_logging(self.fs, path, level)