Logging

From Fallcoast
Jump to: navigation, search

Please feel free to update this page with suggestions for other logging code snippets.

Autologger instructions for MUSHClient

This only works for MUSHClient.

  • File > World Properties
  • General > Logging
  • What to Log - You will want to check Log Output at the VERY LEAST. You may wish to also want to Log Commands, but that is entirely up to you (this will show the text you typed in to execute all commands, e.g. 'n' to go north, 'say Hey guys' to say stuff IC, etc).
  • Under 'Automatically log to this file:' you will want to designate a folder where all logs go. You can use certain code (shown at the bottom) such as %Y for year, %b for month, and %d for day (of the month).

In the below image, as an example, the log will show up as "2011Nov16 Fallcoast" in my log folder (assuming the log is from Nov 16, 2011). If the image is too small to see clearly, just click on it and you'll get a bigger version.

700px-MClientLogging.png

Autologger instructions for SimpleMU

  • Add the following to your @aconnect:


@pemit me=>>> Begin Session Log: Yourcharactername-[mid([edit([time()],%B,-)],0,10)]-[last(time())]

  • If you don't have anything set in your @aconnect already, simply enter this line of text:


@aconnect me=@pemit me=>>> Begin Session Log: Yourcharactername-[mid([edit([time()],%B,-)],0,10)]-[last(time())]

  • So if your aconnect already has you reading bboards it will look like this:


@aconnect me=+bbscan;@pemit me=>>> Begin Session Log: Yourcharactername-[mid([edit([time()],%B,-)],0,10)]-[last(time())]

  • Then, go to Tools > Events, and add an event as shown below (MAKE SURE IT IS A GLOBAL EVENT):


Instructionsforautologger.png

  • To test this, you'll need to disconnect from the M* and reconnect. If you are successful, you'll see a message like this:


Logging started to file c:\program files\simplemu\logs\Glasgow-Sun-Sept-24-2011.txt
>>> Begin Session Log: Glasgow-Sun-Sept-24-2011


Et voila! Autologger! You can fine-tune what dumps into the log by excluding channels and such by further using events, but that's the basics.

CMud Logging

  • Go to package editor Click on show events (yellow flag, left hand side)

  • Make a new event called: onConnect

  • Put something along the lines of


#LO PATH\CHARNAME_%time( dd-mm-yy)

E.G. #LO C:\Users\User\Documents\Logs\Fallcoast\Bronwyn_%time( dd-mm-yy)

  • For PATH put the directory you want it to log to (I have mine split by mush, then character), and CHARNAME is the character you are using if you have separate logins for each.



Zmud Logging

#lo PATH\INSERT YOUR NAME HERE%time( yyyymmdd)}


TinyFugue Logging

To tell TinyFugue to set up logs named by world, which automatically rotate at midnight to log with the new date, use the following steps:

  • Make a directory that you want it to stick all of the logs into. For this example we'll use ~/rplogs
mkdir ~/rplogs
  • Edit your .tfrc file (in your user's home directory) and add the following, then save:
/def -p1 logger = /log -w%1 OFF %;  /log -w%1 ~/rplogs/%1.$[ftime("%F")].log %; /at 00:01 /logger %1
/def -p0 -hCONNECT log_all = /eval /logger ${world_name}
/def -p1 -mglob -h'CONFAIL|ICONFAIL *' recon_on_failure = /log -w%1 OFF%; /repeat -30 1 /connect -b %1

Potato Logging

Instructions for how to set up a daily logroll in Potato can be found here.

Or you can do this(Provided by: Katherine):

The simplest way to log is to use the built in logging feature.

Logging -> Show Log Window

Include Buffer From: - This will capture everything that's currently in the buffer. If you were not already logging, it will capture everything that's in your back scroll. So, basically, it's just like "Save as..." and saves everything. You will input where you what the file saved and waht to name it. There is another option, of course, and this is what I use. Potato can be set up to automatically start logging. It starts when you connect and stops when you disconnect (or choose to end the log) and captures everything that comes through. Each world will have it's own file. I've been logging for years and I have about 150mb of text file saved, so don't worry about space.

Auto Logging

Go to "Options" -> "Configure World" Choose "Auto-Sends" on the left. Under "Send upon first connect, before Login info:" input something like the following...

/log -append 1 -leave 1 -- [/get _name]-[/get _char]-[/time %Y-%m-%d].txt

Now to break that down... /log enables logging. Append means it will append an existing file if it finds one (such as if you close out and come back in on the same day). Get name will get the name of the world, get char will get the character you are logged in as, and the time command will add in the year, month, and date.

This command will create a new .txt file in the same location that Potato.exe is, and that file will be named world-char_name-yy/mm/dd.txt.

When you connect, you should see something like...

Now logging to "C:\Location_Of_Potato\GAMENAME-CHARNAME2016-02-09.txt".

Autologging Instructions for Mudlet

  • Click the package button on Mudlet with your Fallcoast profile open. It looks like a little brown box.
  • Import the XML file.
  • Create a new script by clicking the script button on the top bar. It looks like a pen and paper. Create a new script. Name the script whatever you want, e.g., Autologging Script.
  • Copy and paste the following into the script's body:
 function onConnect()
  --Starting logging. Filename based on date
   local t = getTime()
   local filename = t.year .. "-" .. t.month .. "-" .. t.day .. ".txt"
   Logger:LogSection(filename , {split = 5000})
 end

This will split your log into a new file based on the date every time you open the profile, and also split the file at 5000 lines.

  • If you want to specify the directory, copy and paste the following:
 function Logger:getLogDirectory()
       if string.char(getMudletHomeDir():byte()) == "/" then _sep = "/" else  _sep = "\\" end
       local logdir = "C:" .. _sep .. "Logs" .. _sep
       return logdir
 end

This will put new logs into the folder "C:\Logs". If you wanted to put new logs into a different folder, make sure you use '.._sep ..' in between each new subfolder, i.e., "C:" .. _sep .. "Users" .. _sep .. "(Username)" .. _sep .. "Documents" .. _sep .. "Logs".

Atlantis Logging

1. Under World Defaults in Preferences, go to the tab User Variables. Add a new variable named 'autolog'. Set the value to 'yes'.

2. Navigate to the Events tab, also under World Defaults. Create a new event and name it 'Log Created'. Under conditions, add the following two conditions drop the dropdown box: 'World: Has Just Connected', and 'Variable: Matches Pattern'. Enter 'userconf.autolog', select 'is', and enter 'yes'. Make sure your event is set to execute when all conditions are met.

3. Go to the Actions tab of the Log Created event. Add an action named 'Logfile: Open Specific Logfile'. Select your format, and enter the filename template of your logs. The logs are automatically generated as well as their destination folders.

~/[Parent Folder]/%{world.character}/%{datetime.year}-%{datetime.month}/%{datetime.date}.txt

4. Now that we've configured Atlantis to create a log, we need to make an event to close it. Create an event named 'Log Closed'. Under conditions, add the following: 'World: Has Just Disconnected' and 'Variable: Matches Pattern'. Enter the same values as the 'Log Created' Variable condition you made in step 2.

5. Finally, add an action: 'Log: Close All Logs in World'.

This creates a generic autologger that will log all worlds (and all spawn windows), generating a new logfile for each 24-hour period.