F-3000 Posted April 10, 2016 Report Share Posted April 10, 2016 Hello! I got this fancy problem, that my laptop crashed while I was playing, and the log file got corrupted. I believe that tintin's log writing was interrupted in a middle of a symbol, which is now broken. I'm unable to open it with my ordinary editors (Geany, pluma), as they complain about unknown encoding. I can, however, open it with things like nano and less, propably with muchos other terminal tools. How can I fix the log file? I already tried to edit out anything that "grep --color='auto' -P -n "[\x80-\xFF]" file" gave out, but no help. While that of course was a futile efford, because if the symbol is broken, it's not valid \xXX symbol at all. Windows (7) tips accepted as well. Oh, I was not smart enough to check the file before continuing playing, thus the corrupted point is not at the end of the file, but in middle of it. Link to comment Share on other sites More sharing options...
Implementor Erelei Posted April 10, 2016 Implementor Report Share Posted April 10, 2016 Is the file that important? And writing to a log shouldn't be an issue, even if you crash mid-way writing to it. I write to logs depending on year, month, day, then time_.log. What code do you use to log? I'd suggest something like the following: #event {SESSION CONNECTED} { #script {logFilePath} {date +'logs/%Y/%B/%d/'}; #script {logFileName} {date +'%I_%M%p.log'}; #system {mkdir -p ${logFilePath[1]}}; #log {overwrite} {${logFilePath[1]}${logFileName[1]}} } Simple, and easy to use. Link to comment Share on other sites More sharing options...
F-3000 Posted April 10, 2016 Author Report Share Posted April 10, 2016 It has some things I should take note of - I remember adding markers during playing, I just can't recall what they were about. I shall change the logging so that whenever logging is started, it'll start a new file, instead of append to old. I have this currently: #action {^Prepare yourself. For you are about to <Enter> the Forsaken Lands!$}{.login} #alias {.login} { #read ./prefs/$character; #if {"$class" != ""} { #if {$_system[affects_connected]} {#chat message affects {class: $class}}; #read class_based_stuff/$class; #if {"$cabal" != ""} {#read class_based_stuff/$cabal;}; } { #showme <faa>MISSING CLASS INFO!; }; _start_logging; #read tickers.tin; _create_container_aliases_; }; #alias {_start_logging} { #if {"$character" == ""} { #showme <faa>Variable \$character not set! Wont start logging!; #return {#NOP}; }; #format year %t %Y; #format file {%s_%t.txt} $character %m-%d; #log {a} {logs/$year/$file}; #showme <818>Logging to file "$file" ...; } Logging will start only when I enter the game with a character, and in case relogin after lost connection (ie. when crashing tintin (loops are so lovely), when that "Prepare yourself." wont appear) I can type .login to trigger that stuff. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.