What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

Read LogWindow of HB

Farmbot

New Member
Joined
Jan 15, 2010
Messages
270
Reaction score
0
Hi togehter,
i?m new in C# and really new in writing Plugins or stuff like that.
I looked in the Api Dokumentation but it?s so big i want to ask you if its Possible to read the LogWindow of HB instead of write something to it?

I want to read the LogWindow and if something happen with a specific Text i want to react to it?!

Greetings
Farmbot
 

Attachments

  • Unbenannt.webp
    Unbenannt.webp
    15 KB · Views: 20
try to execute / check whatever you want on event Logging.OnWrite
 
Is it this what you mean?

public static bool LogOnWrite { get; set; }

I think this will only give out True or False, but i need the really Text like "Hello User" or whatever
 
Just read the actual log file in [HB Installation folder]/Logs
 
Read the log file is a crappy way :P

Stormchasing pointed out the right solution, you have to subscribe to the event 'Logging.OnWrite'.
For example:

PHP:
public override void Initialize()
{
	Logging.OnWrite += new Logging.WriteDelegate(Logging_OnWrite);
}

void Logging_OnWrite(string message, Color col)
{
	//message is the new line
}

Search Delegate and Event on Google for more information.
 
Or just use the POI events that create the log entry. It will work for all locales then.
 
Back
Top