Clear Log action

Post comments and suggestions for RoboTask here
adhunkins
Posts: 7
Joined: Tue Mar 19, 2024 3:16 pm
Location: Minneapolis, MN
Contact:

Clear Log action

Post by adhunkins »

I suggest an action to clear the log for a task (default to current task). It could be a new action in the "RoboTask Commands" section. Or it could be in the Settings tab of the task.
Lana_K
Posts: 51
Joined: Tue Jul 14, 2020 7:43 pm
Location: Bristol, UK

Re: Clear Log action

Post by Lana_K »

Sorry, I am just curious, why right-clicking on the log panel and selecting 'Clear Log' is not enough?
adhunkins
Posts: 7
Joined: Tue Mar 19, 2024 3:16 pm
Location: Minneapolis, MN
Contact:

Re: Clear Log action

Post by adhunkins »

An example might be a trigger that records the size of a new window into the log. The log would get very long very quickly. Or, as you say, you'd need to open RoboTask all the time, find the task, and right-click to clear the log so that only the most recent window info shows in the log. If there was the ability to clear the log programmatically, you could just clear the log as a task step just before outputting the info to the log. (That's actually my use case for the feature request.)
Oleg
Site Admin
Posts: 3061
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Clear Log action

Post by Oleg »

Log size has limit. Look at menu Options->Settings
Oleg Yershov
adhunkins
Posts: 7
Joined: Tue Mar 19, 2024 3:16 pm
Location: Minneapolis, MN
Contact:

Re: Clear Log action

Post by adhunkins »

True. But that setting applies to all tasks. And there's no way to know how many characters your task will dump to the log.

It would be nice if the log contained ONLY the log output from the last triggered event. IMHO.

As always, Oleg, thank you for your consideration.
Irishman
Posts: 2
Joined: Thu May 19, 2022 5:39 pm

Re: Clear Log action

Post by Irishman »

I agree with this suggestion. It would be a nice option to clear the log before running a task.
I've been a subscriber for many years and I use RoboTask daily. RoboTask is an EXCELLENT program and gets better with every new feature!
felipe
Posts: 14
Joined: Thu Nov 30, 2023 6:18 pm

Re: Clear Log action

Post by felipe »

I already did a similar thing by creating my own task where it goes into the log file of the defined task and scans the list of lines by older dates
but it does not update in the panel view, you need to restart the program to load the updated log again
OldGeek
Posts: 18
Joined: Thu Jun 01, 2023 2:50 pm

Re: Clear Log action

Post by OldGeek »

felipe wrote: Wed Jun 19, 2024 8:26 pm I already did a similar thing by creating my own task where it goes into the log file of the defined task and scans the list of lines by older dates
but it does not update in the panel view, you need to restart the program to load the updated log again
Any chance you would share this task, it sound better than clearing the whole log.
felipe
Posts: 14
Joined: Thu Nov 30, 2023 6:18 pm

Re: Clear Log action

Post by felipe »

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1864609949
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task39"
Hide=INTEGER|0
ID=INTEGER|717804897
LogOnAsUser=INTEGER|1
Name=STRING|"clear_log"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
StepPause=INTEGER|0
ToLog=INTEGER|1
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER

[Actions\Action1]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"list Name Tasks"
Params=FOLDER

[Actions\Action1\Params]
_rt_variables_produced=STRING|"current_task"
delimiter_no=STRING|"0"
destvar=STRING|"current_task"
line0=STRING|"nameTask"
linecount=STRING|"1"
quote_char=STRING|"0"
sourcetext=STRING|"1"
strict_delim=STRING|"1"

[Actions\Action2]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action2\Params]
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"8"
type=STRING|"0"
value1=STRING|"{GetTaskIdByExtName({current_task})}"

[Actions\Action3]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER

[Actions\Action3\Params]
message=STRING|"taskname: {current_task} - taskID: {GetTaskIdByExtName({current_task})} - logFile: {TaskLogFileById({GetTaskIdByExtName({current_task})})}"
type=STRING|"3"

[Actions\Action4]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"overwrite log file"
Params=FOLDER

[Actions\Action4\Params]
encode=STRING|"0"
fileexists=STRING|"0"
filname=STRING|"{LogFolder}\{TaskLogFileById({GetTaskIdByExtName({current_task})})}"
linecount=STRING|"0"
suppress=STRING|"0"
withoutprefix=STRING|"0"

[Actions\Action5]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"

[Actions\Action6]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER

[Actions\Action6\Params]
message=STRING|"taskname: {current_task} - error"
type=STRING|"2"

[Actions\Action7]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action8]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

felipe
Posts: 14
Joined: Thu Nov 30, 2023 6:18 pm

Re: Clear Log action

Post by felipe »

I didn't add "Restart Robotask"
It is up to you when this will be done.
Post Reply