aboutsummaryrefslogtreecommitdiff
path: root/clog/clog.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-12-29 19:31:39 +0000
committerRunxi Yu <me@runxiyu.org>2024-12-29 19:31:39 +0000
commit603ef6227aca5d635ff5c24e688b39f17d63a3d3 (patch)
tree27e00d3e7810efa4228259d00980b5ef0fcb9957 /clog/clog.go
parentclog: Remove extra newline and fix stderr (diff)
downloadgo-lindenii-common-603ef6227aca5d635ff5c24e688b39f17d63a3d3.tar.gz
go-lindenii-common-603ef6227aca5d635ff5c24e688b39f17d63a3d3.tar.zst
go-lindenii-common-603ef6227aca5d635ff5c24e688b39f17d63a3d3.zip
clog: Add fatal
Diffstat (limited to '')
-rw-r--r--clog/clog.go5
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)
+}