1. These forums are still being retired! Please use GitHub discussions or Discord. You cannot create new threads or new accounts now. If you need to contact some user of the forums, you should do it sooner, rather than later. This notice was last updated on May 30th, 2021.

Resolved [Suggestion] Make logfile name public

Discussion in 'Suggestions' started by GrandPa-G, Feb 4, 2015.

  1. GrandPa-G

    GrandPa-G Developer of many plugins
    Plugin Developer Zero Day Plugin Author

    Joined:
    Jan 4, 2015
    Messages:
    400
    Unless I am missing something, there is no way to know what the current log file is (Please tell me how to find it if possible). I would suggest that the
    privatestaticstring _filename;
    be changed to a public string. I would like to read (parse) the current log file for specific information.
     
  2. nicatronTg

    nicatronTg Shank / hakusaro
    TShock Founder TShock Admin

    Joined:
    Jul 21, 2011
    Messages:
    727
  3. GrandPa-G

    GrandPa-G Developer of many plugins
    Plugin Developer Zero Day Plugin Author

    Joined:
    Jan 4, 2015
    Messages:
    400
  4. nicatronTg

    nicatronTg Shank / hakusaro
    TShock Founder TShock Admin

    Joined:
    Jul 21, 2011
    Messages:
    727
  5. Wight

    Wight Administrator
    TShock Admin TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    May 20, 2012
    Messages:
    1,598
  6. nicatronTg

    nicatronTg Shank / hakusaro
    TShock Founder TShock Admin

    Joined:
    Jul 21, 2011
    Messages:
    727
    Well, yes, but the point of exposing the log file name is slightly moot if you're logging to a database.
     
    • Agree Agree x 1
  7. Olink

    Olink Admin note: Actually a really nice person now

    Joined:
    Jul 21, 2011
    Messages:
    1,397
    Last I checked you wouldn't be able to access the TextLogs member of fileName from the interface. And the whole point of an interface was to eliminate this discrepancy between log types. End users shouldnt need complicated branching to determine what kind of log tshock is using to determine what to do with it, it should ask for a path and be able to go with it. Path should be a member of ILog and return in the case of TextLog the log file, and in Sql either nothing or a
    Code:
    "sqltype:/database"
    I don't know if you guys are not future proofing code or think having end users have a 10 branch if/else if block of code to determine the type of storage when asking what the path is good, but this is a pretty easy fix.