Implementing: LogWrite()

EQ2Emulator Development forum.

Moderator: Team Members

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: New EQ2Emu Logging

Post by John Adams » Thu Sep 02, 2010 8:32 am

That's cool, right on Scat. Thanks for the re-deux ;)

I thought you were going with a bitwise for Console, File, or Both? (plus any future output concepts we dream up)?

I'll try to check it out tonight. Problem is, I just got told family is coming Fri (tomorrow...) so that means a severe house cleaning is in order ;) I'll see if I have time.

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: New EQ2Emu Logging

Post by Zcoretri » Thu Sep 02, 2010 9:09 am

Scat, I tried compiling last night and VS2008 was barking about the logtypes.h file.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: New EQ2Emu Logging

Post by John Adams » Thu Sep 02, 2010 10:51 am

Yeah I dont' think he committed LogTypes.h yet. I don't see it anywhere either.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: New EQ2Emu Logging

Post by Scatman » Thu Sep 02, 2010 6:41 pm

Ugh. Sorry. Just testing you guys!

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: New EQ2Emu Logging

Post by John Adams » Thu Sep 02, 2010 6:47 pm

Ugh, compile error on Linux. makefile?

Code: Select all

g++ -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align -Wno-deprecated -g -march=i686 -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DEQ2 -DWORLD -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include ../common/Log.cpp -o ../common/Log.o
../common/Log.cpp: In function âLogTypeStatus* GetLogTypeStatus(const char*, const char*)â:
../common/Log.cpp:136: error: âstricmpâ was not declared in this scope
../common/Log.cpp: In function âvoid ProcessLogConfig(XMLNode)â:
../common/Log.cpp:165: error: âstricmpâ was not declared in this scope
../common/Log.cpp:177: error: âstricmpâ was not declared in this scope
../common/Log.cpp:185: error: âstricmpâ was not declared in this scope
../common/Log.cpp:193: error: âstricmpâ was not declared in this scope
make: *** [../common/Log.o] Error 1

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: New EQ2Emu Logging

Post by Scatman » Thu Sep 02, 2010 6:49 pm

That's why I hate developing on windows. They allow it because they'll define it for you... sec :P

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: New EQ2Emu Logging

Post by John Adams » Thu Sep 02, 2010 7:00 pm

That's because developing on Windows is for mindless tools that need everything to be decided for them. Eh?

LINUX4EVAH!

Thanks Scat.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: New EQ2Emu Logging

Post by Scatman » Fri Sep 03, 2010 6:56 am

Sorry I couldn't get to this earlier. I kinda fell asleep last night. The code is now compiling on linux. It was alllll fooked up. I have no idea how windows compiled it. Code is comitted to svn. However I will not be able to compile windows until I get home from work. So if anyone has some free time and can grab the latest from svn to do a windows compile, let me know.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: New EQ2Emu Logging

Post by John Adams » Fri Sep 03, 2010 8:40 am

Looks like Win32 Debug and Release compiled just fine on Windows. x64 should work too (doing it now) and Linux x86 also appears to be ok.

Thanks Scatman-doo!


The next thing we need from your Scatliness is to discombobulate the hex crap, which I will work with you on after this holiday weekend. Got family in town, so I'm outie til Tue at the very least.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: New EQ2Emu Logging

Post by John Adams » Fri Sep 03, 2010 9:31 am

And Scat...

bitwise ;)

let's talk.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: New EQ2Emu Logging

Post by John Adams » Fri Sep 03, 2010 9:34 am

Scatman wrote:Well, Mr. Emperor, what do you think of this instead?

Code: Select all

<LogConfig Category="SERVERINIT">
	<LogConfigType Type="STATUS" Color="0" Enabled="True" LogFile="False" Console="True" />
	<LogConfigType Type="WARNING" Color="2" Enabled="True" LogFile="False" Console="True" />
	<LogConfigType Type="ERROR" Color="3" Enabled="True" LogFile="False" Console="True" />
</LogConfig>
More "XMLie" ?
Yes. I like.
Scatman wrote: Edit:
I've also changed the value fields of each key to not care about case. Also, the color field can accept a number OR a color's name - (0 or White), (1 or green), (2 or YELLoW), etc
Can we also allow CSS color styles? #FFFFFF = White, #FF0000 = Red, etc? not sure if C++ interprets that easily. I know it loves RGB though (255,255,255) which I'd like to avoid ;)

I would replace 0, 1, 2 with CSS coloring, since no one knows what 0, 1, or 2 is unless we tell them. that seems rather "hard coded".

just sayin

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: New EQ2Emu Logging

Post by Scatman » Fri Sep 03, 2010 10:18 am

Unfortunately we can't do css style. We are limited by the colors windows and linux gives us. There's on.y about 12 colors we can use. Edit edit and properties on a command prompt and those are the colors we are allowed to use. I changed the color attribute to accept s number or the name of the color.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: New EQ2Emu Logging

Post by Scatman » Fri Sep 03, 2010 10:32 am

I was thinking about the bitwise. Are you sure we want to do that? This is a config file so it should be pretty high level. If a server admin wants to change some settings then they may have to look thru the code yo determine which numbers are for which log. Or we could put comments in the xml file that tells them. Either way then they have to add them up. Or if they want to determine which logs sre on off they are going to have to do some math again. Some people don't understand bitwise. The way it is now is just bam right out there. Usorry for the typos. On my phone

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: New EQ2Emu Logging

Post by John Adams » Fri Sep 03, 2010 11:47 am

Scatman wrote:Unfortunately we can't do css style. We are limited by the colors windows and linux gives us. There's on.y about 12 colors we can use. Edit edit and properties on a command prompt and those are the colors we are allowed to use. I changed the color attribute to accept s number or the name of the color.
Then maybe we drop the #'s and just use english. White, Blue, Magenta, whatevs. I don't see any reason for one or the other.

As for the bitwise values, I think it would make the config far less confusing if it was:

0 = Off (no logging)
1 = Console
2 = File
3 = Console/File

It's not that confusing. Anyone running a server should have some semblance of intellect or, not be messing with non-default logging anyway ;)

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: New EQ2Emu Logging

Post by Scatman » Fri Sep 03, 2010 2:25 pm

Yeah but what if you want 2 types enabled and the other disabled?

Edit:
Oh :P I responded too fast. Sure I can do that.

Double Edit:
BUT! We need to think of the other types of logging we may possibly add (client chat) so we dont keep appending values on. Like:

0=off
1=file
2=console
3=file/console
4=chat
5=console/chat
6=console/file
7=chat/file
8=console/chat/file

Get kinda annoying wouldn't it?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests