rwblinn Well-Known Member Licensed User Longtime User May 16, 2013 #1 Hi All, is it possible to use the Activity name in the Log() routine, like done by B4A in the Logs Tab: ** Activity (main) Resume ** Example what I mean: (main)17:44:58 :: mylog entry as defined by Log("(main)" & DateTime.Time(DateTime.Now) & " :: mylog entry") I was searching for something like Log("(" & Activity.Name & ") " & DateTime.Time(DateTime.Now) & " :: mylog entry") Thank You, Rob
Hi All, is it possible to use the Activity name in the Log() routine, like done by B4A in the Logs Tab: ** Activity (main) Resume ** Example what I mean: (main)17:44:58 :: mylog entry as defined by Log("(main)" & DateTime.Time(DateTime.Now) & " :: mylog entry") I was searching for something like Log("(" & Activity.Name & ") " & DateTime.Time(DateTime.Now) & " :: mylog entry") Thank You, Rob
stevel05 Expert Licensed User Longtime User May 16, 2013 #2 Try B4X: Log(Me) That'll give you the current class name from an activity, from a class it gives rather more, but the info you want is in there. It'll just need extracting. To assign to a readable string that you can extract substrings from do: B4X: Dim m As String = Me Log(m.Substring(6)) or whatever Last edited: May 16, 2013 Upvote 0
Try B4X: Log(Me) That'll give you the current class name from an activity, from a class it gives rather more, but the info you want is in there. It'll just need extracting. To assign to a readable string that you can extract substrings from do: B4X: Dim m As String = Me Log(m.Substring(6)) or whatever