Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by ic · Dec 13, 2010 at 08:09 AM · consoleidetimestamp

Timestamp on Console?

Is it possible to get timestamps to show on the Unity IDE console?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image
7

Answer by relser99 · Aug 31, 2018 at 03:30 AM

I know this question is nearly 8 years old now, but since it's the top Google result for "unity console timestamp", it seems worth mentioning: the Unity console does in fact offer timestamps on log messages as a built-in feature.

To get them, simply open the Console tab's options menu (click the "triple-bar" options button at its top-right corner) and select the Show Timestamp option. The timestamp is only precise to the second, so if you need e.g. milliseconds it looks like you still need to roll your own timestamp.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Neox_30 · Dec 29, 2018 at 10:33 PM 1
Share

Thank you. I had these timestamps at school, but not at home. I was really confused and couldn't find an answer anywhere. I was like "meh I'm sure nobody answered about this here, this is from 2010!"... I'm glad I was wrong :)

avatar image
3

Answer by jonas-echterhoff · Dec 13, 2010 at 11:46 AM

The built-in console does not track timestamps. However, you can hook into debug logging by using Application.RegisterLogCallback. From there you could write the log messages with a timestamp to a file for example.

Duck's suggestion might be more convenient, though, because you can layer it on top of the Unity console window - but this way, you can get timestamps for messages logged by the engine itself as well.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

Answer by habitoti · Feb 01, 2014 at 04:12 PM

Checkout this for a complete solution: http://rombosblog.wordpress.com/2014/02/01/unity-debug-log-console-messages-with-timestamp/

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by salat · Jul 28, 2013 at 07:07 AM

just add this to some .cs file:

 public class Debug
 {
     public static void Log(object obj)
     {
         UnityEngine.Debug.Log( System.DateTime.Now.ToLongTimeString() + " : " + obj );
 
     }
 }

no need to attach to gameobject and no need to modify existing code. note: this will hide default unity Debug class and if you need other methods you might want to add them as well samely

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by duck · Dec 13, 2010 at 11:30 AM

No, Unity doesn't have this feature built-in. I had this requirement myself too, and I ended up writing my own "Debug" class named slightly differently (called "DebugX"), which adds timestamps to everything written.

While I was writing it, I also added the feature of writing lines to a text file within my assets folder, so I could easily see the debug lines without the additional stack trace data, making it easier to read. This might be a useful idea for you too!

Good luck!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Print to console 2 Answers

Monospace Font In Console 2 Answers

Is there any way to view the console in a build? 7 Answers

Method not found: 'UnityEngine.Application.Loadlevel'? 0 Answers

Why Am I getting MissingMethodException message? 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges