Skip to content

Commit

Permalink
version 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
abbbi committed Sep 26, 2022
1 parent 85b7421 commit 02efff1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug report
about: Create a report to help us improve
about: Create a bug report to help us improve
title: ''
labels: bug
assignees: ''
Expand All @@ -20,3 +20,6 @@ A clear and concise description of what you expected to happen.
**Hypervisor information:**
- OS: [e.g. Alma, Debian]
- HV type [e.g. opennebula, plain libvirt, rhev]

**Logfiles:**
Please attach generated logfiles relevant to the reported issue.
6 changes: 6 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 1.6
---------
* virtnbdbackup:
* add --syslog option: enable log output to system syslog
facility.

Version 1.5
---------
* virtnbdrestore:
Expand Down
2 changes: 1 addition & 1 deletion libvirtnbdbackup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

__version__ = "1.5"
__version__ = "1.6"
19 changes: 14 additions & 5 deletions libvirtnbdbackup/common/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import glob
import json
import logging
import logging.handlers
import signal
import shutil
import pprint
Expand Down Expand Up @@ -67,15 +68,23 @@ def getLogFile(fileName):

def configLogger(args, fileLog, counter):
"""Setup logging"""
syslog = False
try:
syslog = args.syslog is True
except AttributeError:
pass
handler = [
fileLog,
logging.StreamHandler(stream=sys.stderr),
counter,
]
if syslog is True:
handler.append(logging.handlers.SysLogHandler(address="/dev/log"))
logging.basicConfig(
level=setLogLevel(args.verbose),
format=logFormat,
datefmt=logDateFormat,
handlers=[
fileLog,
logging.StreamHandler(stream=sys.stderr),
counter,
],
handlers=handler,
)


Expand Down
8 changes: 8 additions & 0 deletions virtnbdbackup
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,14 @@ def main():
)
remopt = parser.add_argument_group("Remote Backup options")
argopt.addRemoteArgs(remopt)
logopt = parser.add_argument_group("Logging options")
logopt.add_argument(
"-L",
"--syslog",
default=False,
action="store_true",
help="Additionally send log messages to syslog (default: %(default)s)",
)
debopt = parser.add_argument_group("Debug options")
debopt.add_argument(
"-q",
Expand Down

0 comments on commit 02efff1

Please sign in to comment.