Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xxdk-wasm
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
xxdk-wasm
Commits
56687774
Commit
56687774
authored
2 years ago
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Fix bugs in emoji logging
parent
314ad61b
No related branches found
No related tags found
2 merge requests
!67
fix for latest client release
,
!61
Add emoji sanitizater
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
emoji/main.go
+5
-7
5 additions, 7 deletions
emoji/main.go
emoji/utils.go
+1
-1
1 addition, 1 deletion
emoji/utils.go
with
6 additions
and
8 deletions
emoji/main.go
+
5
−
7
View file @
56687774
...
...
@@ -53,8 +53,8 @@ var sanitizeEmojis = &cobra.Command{
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
// Initialize the logging if set
if
viper
.
GetInt
(
logLevelFlag
)
!=
0
{
initLog
(
1
,
"emoji-sanitization.log"
)
if
logFile
:=
viper
.
GetString
(
logFileFlag
);
logFile
!=
""
{
initLog
(
viper
.
GetInt
(
logFileFlag
),
logFile
)
}
// Retrieve emoji-mart file from URL
...
...
@@ -110,9 +110,8 @@ func init() {
}
sanitizeEmojis
.
PersistentFlags
()
.
StringP
(
logFileFlag
,
"l"
,
""
,
"Path to the log output path. If logLevel is not set, this flag "
+
"wll be ignored. By default, this flag is not set so a log will not "
+
"be created unless specified."
)
"Path to the log output path. By default, this flag is not set "
+
"so a log will not be created unless specified."
)
err
=
viper
.
BindPFlag
(
logFileFlag
,
sanitizeEmojis
.
PersistentFlags
()
.
Lookup
(
logFileFlag
))
if
err
!=
nil
{
...
...
@@ -121,8 +120,7 @@ func init() {
}
sanitizeEmojis
.
PersistentFlags
()
.
IntP
(
logLevelFlag
,
"v"
,
0
,
"Verbosity level of logging. If not set, this defaults to 0 and will "
+
"not create logs. "
)
"Verbosity level of logging. This defaults to 0. "
)
err
=
viper
.
BindPFlag
(
logLevelFlag
,
sanitizeEmojis
.
PersistentFlags
()
.
Lookup
(
logLevelFlag
))
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
emoji/utils.go
+
1
−
1
View file @
56687774
...
...
@@ -15,7 +15,7 @@ import (
)
// initLog will enable JWW logging.
func
initLog
(
threshold
u
int
,
logPath
string
)
{
func
initLog
(
threshold
int
,
logPath
string
)
{
if
logPath
!=
"-"
&&
logPath
!=
""
{
// Disable stdout output
jww
.
SetStdoutOutput
(
io
.
Discard
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment