99 "sync"
1010 "time"
1111
12- "github.com/ipfs/go-log"
13-
12+ "github.com/keep-network/keep-common/pkg/logging"
1413 "github.com/keep-network/keep-core/pkg/net"
1514 "github.com/keep-network/keep-core/pkg/net/key"
1615 "github.com/keep-network/keep-core/pkg/net/local"
@@ -33,7 +32,8 @@ func init() {
3332 Name : "signing" ,
3433 Usage : "Provides several tools useful for out-of-band signing" ,
3534 Before : func (c * cli.Context ) error {
36- _ = log .SetLogLevel ("*" , "fatal" ) // disable the regular logger
35+ // disable the regular logger
36+ _ = logging .Configure ("keep*=fatal" )
3737 return nil
3838 },
3939 Subcommands : []cli.Command {
@@ -110,17 +110,7 @@ func DecryptKeyShare(c *cli.Context) error {
110110 )
111111 }
112112
113- _ , err = os .Stdout .Write (signerBytes )
114- if err != nil {
115- return fmt .Errorf (
116- "could not write signer bytes to stdout: [%v]" ,
117- err ,
118- )
119- }
120-
121- outputFilePath := c .String ("output-file" )
122-
123- if len (outputFilePath ) > 0 {
113+ if outputFilePath := c .String ("output-file" ); len (outputFilePath ) > 0 {
124114 if _ , err := os .Stat (outputFilePath ); ! os .IsNotExist (err ) {
125115 return fmt .Errorf (
126116 "could not write shares to file; file [%s] already exists" ,
@@ -136,6 +126,14 @@ func DecryptKeyShare(c *cli.Context) error {
136126 err ,
137127 )
138128 }
129+ } else {
130+ _ , err = os .Stdout .Write (signerBytes )
131+ if err != nil {
132+ return fmt .Errorf (
133+ "could not write signer bytes to stdout: [%v]" ,
134+ err ,
135+ )
136+ }
139137 }
140138
141139 return nil
0 commit comments