@@ -28,12 +28,6 @@ func exec() error {
2828
2929 /* exec() wraps run() protecting it with user interrupts */
3030
31- utils .InitLogger (true )
32-
33- /* zap.L() can be used all over the code for global level logging */
34-
35- zap .L ().Info ("Logger Initiated ..." )
36-
3731 /* setting up cobra for cli interactions */
3832 var (
3933 configPath string
@@ -59,9 +53,7 @@ func exec() error {
5953
6054 /* Execute the command */
6155 if err := rootCmd .Execute (); err != nil {
62- zap .L ().Error ("arguements error" ,
63- zap .Error (err ),
64- )
56+ fmt .Printf ("arguements error: %s" , err .Error ())
6557 os .Exit (1 )
6658 }
6759
@@ -76,8 +68,16 @@ func exec() error {
7668 if there is an error or environment variables are not set, then it will exit with code 1
7769 */
7870 config .LoadEnv ()
71+
72+ /*
73+ true for production, false for development mode
74+ logger is only for http server and core components (after this step)
75+ using logger for cli issues doesn't make sense
76+ */
77+ utils .InitLogger (! config .BackendConfig .AppInfo .DebugMode )
7978
80- /* true for production, false for development mode */
79+ /* zap.L() can be used all over the code for global level logging */
80+ zap .L ().Info ("Logger Initiated ..." )
8181
8282 ctx , cancel := context .WithCancel (context .Background ())
8383 defer cancel ()
0 commit comments