diff options
author | Runxi Yu <me@runxiyu.org> | 2024-12-29 19:31:39 +0000 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2024-12-29 19:31:39 +0000 |
commit | 603ef6227aca5d635ff5c24e688b39f17d63a3d3 (patch) | |
tree | 27e00d3e7810efa4228259d00980b5ef0fcb9957 /clog/clog.go | |
parent | clog: Remove extra newline and fix stderr (diff) | |
download | go-lindenii-common-603ef6227aca5d635ff5c24e688b39f17d63a3d3.tar.gz go-lindenii-common-603ef6227aca5d635ff5c24e688b39f17d63a3d3.tar.zst go-lindenii-common-603ef6227aca5d635ff5c24e688b39f17d63a3d3.zip |
clog: Add fatal
Diffstat (limited to 'clog/clog.go')
-rw-r--r-- | clog/clog.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clog/clog.go b/clog/clog.go index b876574..d9162b0 100644 --- a/clog/clog.go +++ b/clog/clog.go @@ -30,3 +30,8 @@ func Debug(str string, keyvals ...any) { func Info(str string, keyvals ...any) { log("INFO "+str, keyvals) } + +func Fatal(exit int, str string, keyvals ...any) { + log("FATAL "+str, keyvals) + os.Exit(exit) +} |