Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove timestamp logging as it is not a daemon #47

Merged
merged 2 commits into from
Dec 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions bin/vhost-gen
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ vHost creator for Apache 2.2, Apache 2.4 and Nginx.
from __future__ import print_function
import os
import sys
import time
import re
import getopt
import itertools
Expand All @@ -30,8 +29,8 @@ if os.environ.get("MYPY_CHECK", False):
# --------------------------------------------------------------------------------------------------
APPNAME = "vhost-gen"
APPREPO = "https://github.com/devilbox/vhost-gen"
VERSION = "1.0.4"
RELDATE = "2022-12-15"
VERSION = "1.0.5"
RELDATE = "2022-12-18"

# Default paths
CONFIG_PATH = "/etc/vhost-gen/conf.yml"
Expand Down Expand Up @@ -89,16 +88,16 @@ def log(level, message, verbosity):
# type: (int, str, int) -> None
"""Log based on current verbosity."""

stime = time.strftime("%Y-%m-%d %H:%M:%S")
# stime = time.strftime("%Y-%m-%d %H:%M:%S")

if level == 0:
print("vhost-gen: \x1b[31;21m[ERROR] (%s): %s\x1b[0m" % (stime, message), file=sys.stderr)
print("vhost-gen: \x1b[31;21m[ERROR] %s\x1b[0m" % (message), file=sys.stderr)
elif level == 1:
print("vhost-gen: \x1b[33;21m[WARN] (%s): %s\x1b[0m" % (stime, message), file=sys.stderr)
print("vhost-gen: \x1b[33;21m[WARN] %s\x1b[0m" % (message), file=sys.stderr)
elif level == 2 and verbosity >= 1:
print("vhost-gen: [INFO] (%s): %s" % (stime, message), file=sys.stderr)
print("vhost-gen: [INFO] %s" % (message), file=sys.stderr)
elif level == 3 and verbosity >= 2:
print("vhost-gen: [DEBUG] (%s): %s" % (stime, message), file=sys.stderr)
print("vhost-gen: [DEBUG] %s" % (message), file=sys.stderr)


def print_help():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="vhost-gen",
version="1.0.4",
version="1.0.5",
description="Configurable vHost generator for Apache 2.2, Apache 2.4 and Nginx.",
license="MIT",
long_description=long_description,
Expand Down