Question: Output Console Log Copy

Discussion in 'Javascript/Plugin Support' started by Rink27, Aug 28, 2017.

  1. Rink27

    Rink27 Veteran Veteran

    Messages:
    222
    Likes Received:
    12
    Location:
    Caribbean
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi. Personally, I don't really like the thought of burdening someone with making a plugin for me, so I'm first asking to see if anything similar exists and hopefully if someone can explain how difficult or easy it can be to achieve? (I haven't find anything like a plugin for this)

    Currently I debug my game by myself by referencing logs to the console during play testing. However, in later stages of my game, I'd like to have other debuggers and I'd like that process to be easy on them.

    Fundamental Requirement:

    Ideally, when you close the game (whether intentionally or it was forced to due to a bug/crash), the game is able to output a copy of the console logs to a file that appears within the game's folder. Debuggers and myself would be able to reference this file.

    Bonus Features:

    * This system would be able to make multiple files. Whenever you close the game intentionally, the copy of the console logs is outputted to a file, say named "consoleGoodCopy.txt". The next copy made overwrites the original.

    * Whenever the game is forced to closed, the copy of the console logs is always outputted to a new file. Say "consoleBadCopyA.txt", then "consoleBadCopyB.txt" if "A" exists, and so on.

    * The designer is able to dictate how many lines from the console is outputted to the file, for example: the last 100 lines.

    This way, I don't have to share an open version of my game to any debugger and their work may be simplified to just playing and sending me any crash reports.
     
    #1
  2. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,580
    Likes Received:
    1,360
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    hi
    1. Enable logging from the command line using the flags:

      --enable-logging --v=1

      This logs everything Chrome does internally, but it also logs all the console.log() messages as well. The log file is called chrome_debug.log and is located in the User Data Directory.

    2. Filter the log file you get for lines with CONSOLE(\d+).
    add flag to
    C\Program Files (x86)\KADOKAWA\RPGMV\nwjs-lnx
    in package.json
     
    #2
    waynee95 likes this.
  3. Rink27

    Rink27 Veteran Veteran

    Messages:
    222
    Likes Received:
    12
    Location:
    Caribbean
    First Language:
    English
    Primarily Uses:
    RMMV
    @Jonforum , from what I understand, this requires having Chrome opened to use. Do I have to run the game in the browser?
    Also not all of my debuggers would be tech savvy, so I think this method would be off-putting to them if they want to hide their personal info that is also logged.

    (Or maybe I misunderstood how this works)
     
    #3
  4. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,580
    Likes Received:
    1,360
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    rmmv alrealy run with node.js and chromius.
    normaly, simply add a flag line in the package.json
    you can find it for windows os
    C\Program Files (x86)\KADOKAWA\RPGMV\nwjs-win
    try add the line like thats for allow chromium to store log
    PHP:
    {
        
    "name""KADOKAWA/RPGMV",
        
    "main""www/index.html",
        
    "js-flags""--expose-gc",

        
    "chromium-args" "--enable-logging --v=1",

        
    "window": {
            
    "title""",
            
    "toolbar"false,
            
    "width"1600,
            
    "height"900,
            
    "icon""www/icon/icon.png"
        
    }
    }


    its work with the consol debug (f8)
    and the log can found in
    '\user\current\AppData\Local\Google\Chrome\User Data
     
    Last edited: Aug 28, 2017
    #4

Share This Page