Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: use subfolders for session logs

  1. #1
    Senior Member
    Join Date
    Oct 2017
    Posts
    306

    Default use subfolders for session logs

    The session log folder can get bogged down with quite a lot of items to scroll through, especially over multiple years of regular play alongside multiple accounts. I think it would be great if it used subfolders. Thus instead of storing everything in:
    /mafia/sessions/

    store it in:
    /mafia/sessions/NAME/YEAR/

    Where:
    NAME = name of account
    YEAR = year of that log. For example 2018

    or maybe the other way around?
    /mafia/sessions/YEAR/NAME/
    Last edited by taltamir; 09-19-2018 at 09:18 PM.

  2. #2
    Senior Member
    Join Date
    Jun 2016
    Posts
    233

    Default

    I could see the case for grouping by name, so you can easily split out different multies, but grouping by year just seems arbitrary and pointless.
    They are all marked with their dates so you can sort them by either date or by filename to easily sort them out, and most of the time you only care about the newest few (which could be a case for grouping them by week, but that gets kinda silly). Anything older than that, and you either have to remember the exact date (in which case you can just open it by name) or you're going to do some sort of search, in which case you are better off if you can filter them into a smaller period (a full year isn't particularly helpful), and/or by using some search functionality that lets you search in the files themselves. Sure, such a search could get faster if you can run it on a single year, but that assumes that: a) you know which year you are looking for. b) your search doesn't let you specify part of the filename (because then you can just input the date right there) and c) that it's a matter of life or death that you get your results a few seconds faster, given that session logs are typically very small, and thus quick to search. (If you don't do stupid stuff, like have your script get stuck in a loop printing the same statement 30000 times).

    And if you want, you can always just do it yourself, it's not like it's that hard to make a map and drop a bunch of files into it once a year.

  3. #3

    Default

    Sorting the folder by reverse date modified seems like a quick permanent solution so that you never need to scroll.

  4. #4
    Senior Member
    Join Date
    Oct 2017
    Posts
    306

    Default

    I could see the case for grouping by name, so you can easily split out different multies, but grouping by year just seems arbitrary and pointless.
    Originally Posted by the dictator View Post
    I am glad you agree that an account name sub-folder would be useful. Even if only that gets implemented it will be a big improvement
    Sorting the folder by reverse date modified seems like a quick permanent solution so that you never need to scroll.
    Originally Posted by lostcalpolydude View Post
    the filename is
    username_YYYYMMDD.txt

    sorting by reverse date will only show the latest for a single account. If you played 3 years on 2 accounts, then showing the latest will show you todays log for account A. While account B's newest log would be 1095 files down.
    While default sorting would show you the newest account A 1095 files down, and the newest for account B 2190 down.

  5. #5

    Default

    There are probably 10 different ways to create a subfolder structure. No one will be happy with any particular choice. Plus it's probably a big hassle to make session_logs() adjust to the change. That sounds like a complete waste of time to implement.

    Also, you failed at reading my post. I said to sort by date modified, not by file name.

  6. #6
    Senior Member
    Join Date
    Oct 2017
    Posts
    306

    Default

    Also, you failed at reading my post. I said to sort by date modified, not by file name.
    Originally Posted by lostcalpolydude View Post
    Oh, I see it now.
    I was just thinking about how the date is in the filename itself, which made me match what you said to what I was thinking instead of what you actually said. My mistake there, sorry.

  7. #7
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,150

    Default

    I support the rejection. A robust script to parse filenames and move them to sub-directories is easy in other scripting environments. Last time I did an "expand" script using bash it was about 15 lines and 15 minutes of work. But I am curious as to why this is a desired KoLmafia feature? What is the use case? What data mining are you trying to do that requires more than a couple of months of data? What questions are you trying to answer than need years of data and will have valid answers given changes in the game and KoLmafia over those years? Would it be more productive to expand your toolbox with other scripting environments that are expected to deal with file systems in ways that ash was deliberately designed not to?

  8. #8

    Default

    I think what they wanted was an easy way to look at today's session log for a second character, which based on default sorting in most file systems would put it after all of the session logs for another character.

  9. #9
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,150

    Default

    I think what they wanted was an easy way to look at today's session log for a second character, which based on default sorting in most file systems would put it after all of the session logs for another character.
    Originally Posted by lostcalpolydude View Post
    Possibly. But even on much maligned Windows I have my default display option set (and sticky) to use the Modified Date. Setting that took less time than this post :-)

    I am also presuming, based on discussion at https://kolmafia.us/showthread.php?22...ht=compression, there is a reason for not doing some kind of self-maintenance of the sessions directory.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  10. #10
    Senior Member
    Join Date
    Oct 2017
    Posts
    306

    Default

    I think what they wanted was an easy way to look at today's session log for a second character, which based on default sorting in most file systems would put it after all of the session logs for another character.
    Originally Posted by lostcalpolydude View Post
    Mostly that, and I had completely forgotten I could have windows sort by date modified. Although it is not just looking at the latest logs, but sometimes older logs. For example trying to verify exactly how many neverending party rewards I had opened so far on an account.

    Also OCD. I obsessively keep and organize all my documents since ever. So even if I can easily sort it, I still want it filed in proper subdirectories.

    Also, I was under the impression that some scripts might want to access those logs, which would not work if they are manually moved around willy nilly.

    And I also thought there would be no actual harm done by having mafia automatically separate different accounts / years, while being a very simple thing to implement. It is fairly standard for log keeping to separate by account and by year. So even if the improvement itself is minor, it doesn't cause any harm or take much effort.
    Last edited by taltamir; 09-23-2018 at 01:29 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •