#Debug Logs when IsDebug is False

1 messages · Page 1 of 1 (latest)

earnest trellis
#

Hello Heathen Support,

I'm noticing that there's several debug logs leaking through when IsDebug is set to false. Notably: Initialising Steam Tools Events, Found SteamTools.Game in assembly: Assembly-CSharp, Initialising for app ######, and Local User: Username. In the code, it does not appear that these get wrapped with the IsDebugging flag like the other debug logs. Can these be wrapped or is there a way to silence these debug logs when we're making release builds? We're pulling in the package by manually pulling it from Github and adding it to the Packages folder. We're currently on commit SHA: 77afe7c247573d47db3f45e79c8246281f26673e. Please let me know if anything else would be helpful. Thanks!

uncut echo
#

In editor its overriden to always debug as I recall

earnest trellis
#

These are in production builds, not in editor

uncut echo
#

Debug.Log is still used in a few places rather or not IsDebug is true

You can force it to not write to the log in Unity though

#

its in the proejct settings

#

you can dictate at what level logging still writes

#

I will have a look over the SteamTools namespace and limit more of our logs to only when IsDebugging is true its honestly a bit of a relic of the past as Unity project settings does this for you

#

but fair enough you see the feature you expect it to do what it says

earnest trellis
#

Much appreciated, yea I'll have to take a look at that setting, though we also use Sentry which picks these up as breadcrumbs so I'm not actually sure disabling from the project settings for writing to the log file will actually fix it fully

uncut echo
#

this way everything works the same way and has 1 control

#

our IsDebugging is just a relic of the before times

earnest trellis
#

ah gotcha, i'll definitely take a look at that. Thanks for the help!

earnest trellis
# uncut echo The "Unity Way" is in the settings ideally you wouldn't waste effort with a boo...

I'm looking in the Unity settings and the only thing I see related is the Stack Trace section. Is this what you were referring to? If so, is there a way to limit the disabling of logs to specific assemblies like the steamworks package? We still want to see our own debug logs to debug our code, we just want to be able to shut off all the debug logs, but not warns/errors, from this package when making a release build.

uncut echo
#

Generally for a release build you shut off all logs except errors

And no Unity's setting applies globally it doesn't differentiate by assembly I suppose in there mind a Dev build should log all the things, a beta build should log most hte thigns and a relase build should log none of the things

#

Most devs would use a prefix so you can search and filter the logs there are even tools out there that will do that for you

#

so for exaample

[SomeCoolGame] - My Log Message

#

so your filter would be "SomeCoolGame" and it would only show you the lines that start with that or have that in the text

#

that is how Unreal and others do it anyway

#

Unity's logging system is much more basic

#

still you can do that and use a log reader on the .txt file

earnest trellis
#

I guess my biggest issue is the log line where it prints out the steam username is not ideal for our anonymized sentry traces so if its still spitting out, even if I filter by prefix, its still in the data. So ideally the IsDebug would prevent that from being logged

uncut echo
#

Steam is by definition a DRM that links a license with a user

#

I get the desire

#

but you would have to do your own scrubbing to get rid of the unique IDs

#

the address of a Steam conneciton is the User's ID for example

earnest trellis
#

Interesting, yea we aren't really using the steam feature set past the most basic functionality right now, but I just want to be cognizant of ensuring there isn't PII in logs

uncut echo
#

the initalization, authenticaiton, ids, etc.

#

area ll tied to a specific user running a specific app

#

agian Staem is a DRM

#

99% of its job is ensuring this user is who they say they are and do own a license ot what they say they do

#

generally though a game log would not leave the user's machine unless the user wants it to

#

we even have a tool in our UX toolkit that writes a much more robust log that gathers hardware data as well

#

and then lets you package that to submit via email or you can even set up integrations with 3rd party tools like Zendesk

#

been a bit since I looked at that tool Unity's own UGS ate our lunch with that one 🙂

earnest trellis
#

Yea we've been using sentry so far so it handles all the collecting of hardware data to help us debug issues so on that front we're covered. I just need to make sure there's no linkable PII in any of the breadcrumbs it uses or that would potentially violate anonymized crash data

uncut echo
#

Steam IDs vs PPI is an interesting topic especially with things like GDPR

Yes a Steam ID is unique, however you can only link that to a person if that persons account is not private

#

but the Steam ID its self is not private all Steam IDs are publicly accessable jsut on Steam DB and similar

#

how much info shows wiht it ... that does very

earnest trellis
#

My concern isn't the steamID, it's printing out the actual username. The steamID isn't getting logged at all

uncut echo
#

you shoudl see the Hex version of the Steam ID

#

just before it logs the User's display name and steam level

#

but again

You would have to scrub logs in your case if you want to assure anonymity

#

I would sugest not sending the whole log

earnest trellis
#

I do not see any hex version of the steamID

uncut echo
#

but rather registering on the log event, write your own log and only cache the ones from your code

#

there will always be a chance that a general exception log can spit out a param such as the user's hex ID, display name, entry IDs, etc.

earnest trellis
#

The only logs I see being picked up by the breadcrumbs are Initialising Steam Tools Events, Found SteamTools..Game in assembly: Assembly-CSharp, Initialising for app 251670, and then Local User: Name:Level

#

But I do get what you mean by needing a custom logger

uncut echo
#

I'll have a look at that it should be logging the account ID for the user as well as that would be important for debugging

#

that event I was menitonedin

Application.logMessageReceived += HandleLog;
```\
#

so I would do that

and in my handler I would check the logString that comes in and see if it starts with some token you define

#

so for exmaple

[CrashLog] -

or whatever suits you

so if you see that cache it to yoru own intenral storage or if you hate your user's CPU 😄 write it to file right away

#

anyway ... point is you catch your logs only or whatever logs you sniff out by token

#

you could also filter on LogType as well

#

so for exmple

if exception or warning or logString.StartsWith("someToken")

#

but if you do have the rule of anonomized messags do be warned a stack trace may include IDs which in Steam land would be linked ot the authenticated user

earnest trellis
#

That's interesting, why would stack traces have the IDs in it? Wouldn't it just be function signatures? (Unless it's being logged and the stack trace is from the log itself)

uncut echo
#

You could also find replace the user's display name or any other info you deemed in appropreate to cache

#

that wont catch everything but it would catch the human readable name if nothing else

#

but you still run the risk of leaking other user's names

#

assuming your game is multiplayer

#

interesting topic sorry I dont have cleaner simpler answer for you

almost 4am here so I should log and get an hour or so sleep before I start back at it 😄