From: bruce Date: Thu, 25 Apr 2024 13:48:14 +0000 (+0000) Subject: feat(components): 1, add method IOWriter to return io writer for Logger. X-Git-Tag: v0.2.4 X-Git-Url: https://git.uzoombox.com/git/?a=commitdiff_plain;h=f71f1e066bc0887030de2ba73289cacc2c537296;p=uzsdk-v0.3.1.git feat(components): 1, add method IOWriter to return io writer for Logger. 2, return string key directly if key's value not found in translations. --- diff --git a/.gitignore b/.gitignore index a08cd0d..dbd8e5a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,4 @@ *.exe *.zip *.har -*.swp -.git.*/ \ No newline at end of file +*.swp \ No newline at end of file diff --git a/uzsdk/logger/logger.go b/uzsdk/logger/logger.go index f974882..30cd55a 100644 --- a/uzsdk/logger/logger.go +++ b/uzsdk/logger/logger.go @@ -78,6 +78,10 @@ func New(path, logv, prefix string, options ...interface{}) *Logger { } } +func (l *Logger) IOWriter() *os.File { + return l.out +} + // Fatal calls output(Fatal, Sprint(v)) to print the log. func (l *Logger) Fatal(v ...interface{}) { l.Output(Fatal, "FATAL", fmt.Sprint(v...)) diff --git a/uzsdk/translations/translation.go b/uzsdk/translations/translation.go index 6dd903c..ac5ed93 100644 --- a/uzsdk/translations/translation.go +++ b/uzsdk/translations/translation.go @@ -23,5 +23,5 @@ func Translate(language *string, key string) string { return value } } - return "" + return key } diff --git a/version.go b/version.go index 42b77fd..602740c 100644 --- a/version.go +++ b/version.go @@ -66,4 +66,4 @@ require ( package uzsdk // Version is the current opensdk's version. -const Version = "1.0.0" +const Version = "0.2.4"