@@ -24,7 +24,7 @@ public function __call($name, $arguments)
2424            $ name'debug ' ;
2525        }
2626
27-         return  call_user_func_array ([ ' Illuminate\Support\Facades\Log ' ,  $ name] , $ arguments
27+         return  self :: __callStatic ( $ name$ arguments
2828    }
2929
3030    /** 
@@ -35,6 +35,10 @@ public function __call($name, $arguments)
3535     */ 
3636    public  static  function  __callStatic ($ name$ arguments
3737    {
38+         if  (!in_array ($ nameself ::$ LOG_LEVELS 
39+             $ name'debug ' ;
40+         }
41+ 
3842        if  (session_status () == PHP_SESSION_NONE ) {
3943            $ arguments1 ]['sid ' ] = session_id ();
4044        } else  {
@@ -52,6 +56,7 @@ public static function __callStatic($name, $arguments)
5256        $ trackIdKeyenv ('XLOG_TRACK_ID_KEY ' , 'xTrackId ' );
5357
5458        // get request track ID from service container 
59+ 
5560        if  (!isset ($ arguments1 ][$ trackIdKey
5661            $ arguments1 ][$ trackIdKeyself ::getTrackId ($ trackIdKey
5762        }
@@ -65,20 +70,20 @@ public static function __callStatic($name, $arguments)
6570     * 
6671     * @return mixed 
6772     */ 
68-     public  static  function  exception (Exception $ e$ level 'error ' )
73+     public  static  function  exception (Exception $ e$ name 'error ' )
6974    {
7075        $ trackIdKeyenv ('XLOG_TRACK_ID_KEY ' , 'xTrackId ' );
7176
7277        $ arguments
7378        $ arguments0 ] = 'exception '  . $ egetMessage ();
7479        $ arguments1 ] = [
75-             'code '  => $ egetCode (),
76-             'file '  => basename ($ egetFile ()),
77-             'line '  => $ egetLine (),
78-             $ trackIdKeyself ::getTrackId ($ trackIdKey
80+             'code '        => $ egetCode (),
81+             'file '        => basename ($ egetFile ()),
82+             'line '        => $ egetLine (),
83+             $ trackIdKeyself ::getTrackId ($ trackIdKey, 
7984        ];
8085
81-         return  call_user_func_array ([ ' Tartan\Log\Logger ' ,  $ level ] , $ arguments
86+         return  self :: __callStatic ( $ name $ arguments
8287    }
8388
8489    /** 
@@ -93,6 +98,8 @@ protected static function getTrackId($trackIdKey)
9398        } catch  (Exception $ e
9499            $ trackId'- ' ;
95100        }
101+ 
96102        return  $ trackId
97103    }
104+ 
98105}
0 commit comments