mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-04-24 07:36:53 +08:00
log: use hostname directly
This commit is contained in:
parent
dc92cd249b
commit
8c289c8c3c
|
@ -33,13 +33,6 @@ def get_uuid() -> str:
|
|||
return str(uuid.uuid5(namespace, get_uuid_raw()))
|
||||
|
||||
|
||||
def get_hostname() -> str:
|
||||
ans = socket.gethostname()
|
||||
if '-' not in ans:
|
||||
ans += "-ibd-ink"
|
||||
return ans
|
||||
|
||||
|
||||
def post_log(url:str, hostname:str, uuid:str, content:str):
|
||||
ans = requests.post(url, params={"hostname": hostname, "uuid": uuid}, data=content)
|
||||
return ans
|
||||
|
@ -52,7 +45,7 @@ if __name__ == "__main__":
|
|||
args = parser.parse_args()
|
||||
url = args.url
|
||||
content = args.content
|
||||
hostname = get_hostname()
|
||||
hostname = socket.gethostname()
|
||||
uuid = get_uuid()
|
||||
content=content.strip()
|
||||
if not content:
|
||||
|
|
Loading…
Reference in New Issue
Block a user