mirror of
https://github.com/AdaCore/git-hooks.git
synced 2026-02-12 12:43:11 -08:00
32 lines
771 B
Python
Executable File
32 lines
771 B
Python
Executable File
#!/usr/bin/env python
|
|
"""Usage: stdout-logger [-p pri] [-t tag] message
|
|
"""
|
|
from __future__ import print_function
|
|
|
|
from argparse import ArgumentParser
|
|
|
|
|
|
def stdout_logger():
|
|
parser = ArgumentParser()
|
|
parser.add_argument(
|
|
"-t",
|
|
"--tag",
|
|
dest="tag",
|
|
default="[username]",
|
|
help="Mark every line to be logged with the specified TAG.",
|
|
)
|
|
parser.add_argument(
|
|
"-p",
|
|
"--priority",
|
|
dest="priority",
|
|
help="Enter the message into the log with the specified PRIORITY.",
|
|
)
|
|
parser.add_argument("message", help="The message to be filed in the syslog.")
|
|
|
|
args = parser.parse_args()
|
|
print("SYSLOG: %s: %s" % (args.tag, args.message))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
stdout_logger()
|