aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2020-07-13 13:28:30 +0100
committerGitHub <noreply@github.com>2020-07-13 13:28:30 +0100
commitc8a3937ea0bcd0ef8dd0ed7b83f4af50f92d588f (patch)
tree74afdd18022048f0198330bd4cdf7a66d8fa560d
parentc4067372dddbabd327cda1d4a821ef6b343a29b1 (diff)
parentf9a6777e3afd75266a0fa34f307f98a9204085de (diff)
Merge pull request #695 from jharler/master
Added "sep" parameter to logging procs
-rw-r--r--core/log/log.odin24
1 files changed, 12 insertions, 12 deletions
diff --git a/core/log/log.odin b/core/log/log.odin
index d932da5db..33be15931 100644
--- a/core/log/log.odin
+++ b/core/log/log.odin
@@ -93,20 +93,20 @@ fatalf :: proc(fmt_str: string, args: ..any, location := #caller_location) {
logf(level=.Fatal, fmt_str=fmt_str, args=args, location=location);
}
-debug :: proc(args: ..any, location := #caller_location) {
- log(level=.Debug, args=args, location=location);
+debug :: proc(args: ..any, sep := " ", location := #caller_location) {
+ log(level=.Debug, args=args, sep=sep, location=location);
}
-info :: proc(args: ..any, location := #caller_location) {
- log(level=.Info, args=args, location=location);
+info :: proc(args: ..any, sep := " ", location := #caller_location) {
+ log(level=.Info, args=args, sep=sep, location=location);
}
-warn :: proc(args: ..any, location := #caller_location) {
- log(level=.Warning, args=args, location=location);
+warn :: proc(args: ..any, sep := " ", location := #caller_location) {
+ log(level=.Warning, args=args, sep=sep, location=location);
}
-error :: proc(args: ..any, location := #caller_location) {
- log(level=.Error, args=args, location=location);
+error :: proc(args: ..any, sep := " ", location := #caller_location) {
+ log(level=.Error, args=args, sep=sep, location=location);
}
-fatal :: proc(args: ..any, location := #caller_location) {
- log(level=.Fatal, args=args, location=location);
+fatal :: proc(args: ..any, sep := " ", location := #caller_location) {
+ log(level=.Fatal, args=args, sep=sep, location=location);
}
panic :: proc(args: ..any, location := #caller_location) -> ! {
@@ -121,12 +121,12 @@ panicf :: proc(fmt_str: string, args: ..any, location := #caller_location) -> !
-log :: proc(level: Level, args: ..any, location := #caller_location) {
+log :: proc(level: Level, args: ..any, sep := " ", location := #caller_location) {
logger := context.logger;
if level < logger.lowest_level {
return;
}
- str := fmt.tprint(..args); //NOTE(Hoej): While tprint isn't thread-safe, no logging is.
+ str := fmt.tprint(args=args, sep=sep); //NOTE(Hoej): While tprint isn't thread-safe, no logging is.
logger.procedure(logger.data, level, str, logger.options, location);
}